[英]How to Intent Dynamically generated EditText data in Android?
I am able to generate multiple editText dynamically, but don't understand how to intent its text on Next activity by using intent 我能够动态生成多个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());
}
add all editexts to on list.. 将所有editexts添加到列表中。
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])
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.