String item = (String)parent.getItemAtPosition(position);

this will do..




On Oct 6, 3:30 pm, ragavendran s <sraghav.ra...@gmail.com> wrote:
>   can anybody tell how to retrieve the Listitem values from a list view
>
>   For example.....i m having 3 listitems such as 1.India
>                          2.America
>                          3.Australia
>
>   if i click india in a listview it should display India...How can i get the
> list item value
>
>   Here i m using ListActivity....
>
>   Here is my code....
>
>    String[] items={"India","Australia","America"};
>
>                 setListAdapter(new ArrayAdapter<String>(this,
>                android.R.layout.simple_list_item_1,options1));
>               getListView().setTextFilterEnabled(true);
>
>         public void onListItemClick(ListView parent, View v,
>         int position, long id) {
>
>             super.onListItemClick(parent, v, position, id);
>
>             if(position==0)
>
>             {
>
> Toast.MakeText(getBaeContext(),"",toast.length_short).show();
>
>             }
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to