mohan
mohan

Reputation: 13165

list view issue in android

I am using a custom list view. I have tried to get the value of the row which the user clicked. Can anybody tell me how to get the value?

Thanks

Upvotes: 1

Views: 285

Answers (1)

methode
methode

Reputation: 5438

You may want to implement a new method in your class, specifically onItemClick:

[...]
private ListView lv;
[...]
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
    String itemValue = lv.getItemAtPosition(position);
    [... do something ...]
}

Then you can do whatever you want with with itemValue. Hope this helps.

Upvotes: 2

Related Questions