简体   繁体   中英

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

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..

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM