Actually, they both return a View. You need to cast the View to the
type
> you created as your entries (e.g., TextView), then get the data out of
> there (e.g., getText().toString()). If you're relying on the adapter's
> built-in row types, they'll be TextView instances.

Yes, I did do that, it shows some weird string, not the stuff I want.
Here's some code:

public void onItemClick(AdapterView arg0, View arg1, int position,
long arg3) {
                        // TODO Auto-generated method stub


                        new AlertDialog.Builder(activity)
                        .setTitle("Fruit" )
                        .setMessage("Is" + **[FRUITNAME]**+" your favourite")
                        .setPositiveButton ("Yes", yesListener)
                        .setNegativeButton("No", noListener)
                        .show();



This alert is shown after the user picks a fruit out of a ListView, by
clicking on it. Now, I want to show  **[FRUITNAME]** , for which I
need to know the name of the clicked-fruit. I read these fruits in
through a cursor and a SimpleAdapter. I need to know how to get the
name of the clicked fruit from the listView.

Thanks.
Sylvester
--~--~---------~--~----~------------~-------~--~----~
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