Wednesday, 15 September 2010

android - How can I add event handling in each row in ListView -


I am making a cursor adapter to provide data for my ListView.

I want to show the data in a row of my list view to apply the bindView () method but at the end of my bound view, I add the clicker. But when I run it on the emulator, I do not see any print statement.

Can you please tell me how to add event handling in a row in the listview?

  View.setOnClickListener (New OnClickListener () {public void onClick (see v) {System.out.println ("an onclick event is occurring ....");}}); You can add OnItemClickListener to ListIview - not separate rows.  

  listView.setOnItemClickListener (new OnItemClickListener () {public void OnItemClick (adapter view & lt;? & Gt; arg0, view view, int arg2, long arg3) {Log D. ("tag", "clicked");}});  

No comments:

Post a Comment