I have successfully created EditTexts depending on the user input in Android, and also I have assigned them unique ID\'s using setId() method.
Now wha
You can also do like this by taking an Array of EditText. You should store all references to all EditTexts:
EditText ed[] = new EditText[count];
for (int i = 0; i < count; i++) {
ed[i] = new EditText(Activity2.this);
ed[i].setBackgroundResource(R.color.blackOpacity);
ed[i].setId(id);
ed[i].setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
linear.addView(ed[i]);
}
and you can use for loop to get the value from the EditText .
for(int i = 0; i < ed.length; i++){
Log.d("Value ","Val " + ed[i].getText());
}