android - Sending arrayList<string> with intent -
i have made list of names need send different activity this:
for(i=0;i<n;i++) { imena[i] = player[i].tostring(); } allplayers = new arraylist<string>(); collection l = arrays.aslist(imena); allplayers.addall(l);
i'm not sure if correct, in other activity need set text of dynamically made edittext boxes names have set list, try:
if(bundle!= null) { allplayers = bundle.getstringarraylist("allplayers"); (i = 0;i<n;i++) { player[i] = new edittext(getapplicationcontext()); player[i].settextsize(20); string p1 = allplayers.get(i).tostring(); player[i].settext(p1); root.addview(player[i]); } }
as result editboxes filled text: "android.widget.edittext{4085a09....}" ideas how actual names in boxes?
you have:
imena[i] = player[i].tostring();
note player
array of edittext, not string, need call player[i].gettext().tostring()
rather player[i].tostring()
value of edittext.
Comments
Post a Comment