android - difficulties facing with multiple selection in listview -


i have listview has multiple selections. in each item, there textview saying "more". on clicking on textview, shows details of product on next page.

i have done in listview's onitemclicklistener pr_id = tx.gettext().tostring(); tx text view in list having product id , pr_id product id sending next page through intent.`

more.setonclicklistener(new onclicklistener() {                  @override                 public void onclick(view arg0) {                     // todo auto-generated method stub                      intent i1 = new intent(product_list.this,                             product_view.class);                     i1.putextra("productid", pr_id);                      log.i("pid", pr_id);                      startactivity(i1);                  }             });` 

everything works fine, problem since have multiselection , user has selected 3 items listview in order of 1st, 2nd , 3rd, when click on 1st item's "more" button.

clicking 'more' button should show details of 1st item. but, since have selected 3rd item in list, these details shown instead, meaning last selected item holds view instead of selected 1st item.

how can overcome problem?

in listviewadapter when creating view list item, use settag() on "more"-textview add pr_id it. in more's listener call gettag() retrieve right id.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -