Problem with Android Programming. FOR [closed]

1

Can not generate the amount of EditTexts based on the for parameter? Where is the error?

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main4);



    layout = (LinearLayout) findViewById(R.id.layoutEdits);

    int qtd = getIntent().getIntExtra("ValorDados", 0);
    vetorEdits = new EditText[qtd];

    for (int i = 0; i < qtd; i++) {

        vetorEdits[i] = new EditText(Main4Activity.this);
        vetorEdits[i].setHint("Valor do Edit " + (i+1));

        layout.addView(vetorEdits[i], new ViewGroup.LayoutParams(
                LinearLayout.LayoutParams.MATCH_PARENT,
                LinearLayout.LayoutParams.WRAP_CONTENT));

    }
    
asked by anonymous 28.10.2017 / 15:23

0 answers