Wednesday, December 29, 2010

[android-developers] On which list item user click

Hi all,
In my application I am displaying list of data from database
using SimpleCursorAdapter class. This list contains 6 columns. Now I
want to know on which row user had clicked. I want to delete that
record on which user had clicked. I had override
protected void onListItemClick(ListView l,View v,int position,long id)
{
super.onListItemClick(l, v, position, id);
System.out.println ("User click on list item");
}

method. If I click on ay row then above code execute. But I want to
find out value in these columns. If I add
removeSwitch = l.getItemAtPosition(position).toString(); then it
returns android.database.sqlite.SQLiteCursor@43d2a490. So how I came
to know which entry from database I want to delete?

Thanks

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment