I want to get the index of the Selected Item ( Clicked ) in a ListView.
Can any one please tell me?
Thanks Deepak
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);
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With