我能够动态生成多个editText,但不了解如何使用intent将其文本用于Next活动
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());
}
将所有editexts添加到列表中..
List<EditText> edt_all = new ArrayList<EditText>();
然后你会得到数据
for(int i=0; i < edt_all.size(); i++){
string[i] = edt_all.get(i).getText().toString();
Log.e("##edittext ", string[i])
}