string - Assigning TextView to selected Listview items -
i have string array has multiple strings in listview, e.g. {apples, oranges, banana, ...etc}. want if user choses more 1 item, oranges & banana, text added oranges , banana. added intent, send activity. code this:
if(selected.get(i).equals("oranges"){ textview torange = (textview) findviewbyid(r.id.t1); torange.settext("oranges sour"); } if(selected.get(i).equals("banana"){ textview tbanana = (textview) findviewbyid(r.id.t1); tbanana.settext("banana healthy"); } intent c = new intent(main.this, myfruits.class); bundle b = new bundle(); b.putstring("torange", tpnp.gettext().tostring()); b.putstring("tbanana", tcheckers.gettext().tostring()); c.putextras(b); startactivity(c);
now want activity myfruits.class display 2 textviews, i.e. "oranges sour" , "bananas healthy"
Comments
Post a Comment