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));
}