Android List View Item is not working correctly -


i trying show view form listviewitem, when checked item listitems not working. here code below using.

public class contentlist<view> extends listactivity {         string [] list = {"list item 1","list item 2","list item 3"};          @override      protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_content_list);          listview lstview = getlistview();         lstview.setchoicemode(listview.choice_mode_multiple);         lstview.settextfilterenabled(true);          setlistadapter(new arrayadapter<string> this, android.r.layout.simple_list_item_checked,list));     }      public void onlistitemclick(listview parent, view v,int pos, long id){         checkedtextview item = (checkedtextview) v;         toast.maketext(this, list[pos] + "checked : "+ !item.ischecked(), toast.length_long).show();         }  } 

i see 2 problems , both toast:

  1. since in onclick(), instead of this context should contentlist.this
  2. the second param of maketext() takes either charsequence or int have boolean in there ischecked() need determine should before line , use "true" or "false" or whatever want needs charsequence

if these don't fix problem please state exact problem , if crashing post logcat.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -