After adding following I got value of list as
protected void onListItemClick(ListView l,View v,int position,long id)
{
cursor = (Cursor) myAdapter.getItem(position);
super.onListItemClick(l, v, position, id);
System.out.println ("User click on list item");
String sn = cursor.getString(cursor.getColumnIndex("RoomName"));
System.out.println ("^^^"+sn);
}
Thanks.
On Dec 30, 9:36 am, "pramod.deore" <[email protected]> wrote:
> 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.sqlitecur...@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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en