20 messages in com.googlegroups.android-beginners[android-beginners] Re: getting item ...
FromSent OnAttachments
Sylvester Steele21 Jun 2008 07:22 
Mark Murphy21 Jun 2008 09:23 
Sylvester Steele21 Jun 2008 20:48 
Sylvester Steele21 Jun 2008 20:56 
Mark Murphy22 Jun 2008 05:00 
Sylvester Steele22 Jun 2008 23:09 
Sylvester Steele26 Jun 2008 02:23 
Romain Guy26 Jun 2008 02:31 
Sylvester Steele26 Jun 2008 08:51 
Romain Guy26 Jun 2008 08:59 
Fräntz Miccoli26 Jun 2008 09:00 
Sylvester Steele26 Jun 2008 23:06 
Romain Guy26 Jun 2008 23:34 
Sylvester Steele27 Jun 2008 11:10 
Romain Guy27 Jun 2008 11:18 
jan....@gmail.com27 Jun 2008 11:19 
Mark Murphy27 Jun 2008 11:33 
Romain Guy27 Jun 2008 11:46 
Mark Murphy27 Jun 2008 11:52 
Sylvester Steele29 Jun 2008 02:55 
Subject:[android-beginners] Re: getting item name from listview.
From:Sylvester Steele (sylv@gmail.com)
Date:06/26/2008 08:51:11 AM
List:com.googlegroups.android-beginners

On Jun 26, 2:31 pm, "Romain Guy" <roma@google.com> wrote:

Somewhere, you must have created an Adapter and set it on the ListView. In your onItemClick() method, there's a parameter called position. It gives you the index of the clicked item in the adapter. You just need to call myAdapter.getItem(position) and you will get the result you want.

I tried this. I want to set the string I get, as the title, so I do a myAdapter.getItem(position).toString() , however this gives me something like :

android.database.BulkCursorToCursorAdaptor@4004c850

which is not the clicked item. This is a SimpleCursorAdapter.

Thanks, Sylvester