No, I told you twice already. The item you get back from the adapter
is a Cursor in your case. Which means you have to ask the Cursor for
the value in the appropriate column. You cannot cast it to a TextView
because it is not a View, but a Cursor.

On Fri, Jun 27, 2008 at 11:10 AM, Sylvester Steele
<[EMAIL PROTECTED]> wrote:
>
>
>
> On Jun 27, 11:35 am, "Romain Guy" <[EMAIL PROTECTED]> wrote:
>> getChildAt(position) won't work if you scroll the list. You are just
>> trying to retrieve the data in an unusual way. Like we said before,
>> you should talk to the Adapter, not to ListView to get the data.
>
> If you are suggesting that I do:
>
> fruitsAdapter.getItem(position).toString()  this gives me a weird
> string
>
> typecasting that to a textView and using getText doesn't work. I am
> ready to get this item any way (from the list, cursor or adapter), I
> just want the exact string of the item I have clicked on, in the
> easiest possible way.
>
> Thanks,
> Sylvester
>
>
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to