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

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -