Reputation: 105
I am able to generate multiple editText dynamically, but don't understand how to intent its text on Next activity by using intent
public void onAddField(View v) {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View rowView = inflater.inflate(R.layout.field, null);
parentLinearLayout.addView(rowView, parentLinearLayout.getChildCount() - 1);
}
public void onDelete(View v) {
parentLinearLayout.removeView((View) v.getParent());
}
Upvotes: 0
Views: 62
Reputation: 91
add all editexts to on list..
List<EditText> edt_all = new ArrayList<EditText>();
and then you will getdata
for(int i=0; i < edt_all.size(); i++){
string[i] = edt_all.get(i).getText().toString();
Log.e("##edittext ", string[i])
}
Upvotes: 2