tags:

views:

47

answers:

1

Hi,

I want to get the index of the Selected Item ( Clicked ) in a ListView.

Can any one please tell me?

Thanks Deepak

+4  A: 

You need to use an AdapterView and its onItemClick method :

lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
    public void onItemClick(AdapterView<?> list, View v, int pos, long id) {
        yourAdapter.getItem(pos);           
    }
});
Sephy
Thanks... Its work.
Deepak
You have a low rate. Important on SO, you have to mark accepted answers by using the tick on the left of the posted answer, below the voting. This will increase your rate.
Pentium10