Multiple ListViews and onClick problem by finding out which ListViews is clicked
i am not very familiar with android coding so try to help me on a easy way.
The problem开发者_如何学Go: I have 2 Listviews and a onClick event handler. How can i find out on which listview the user currently clicked?
public void onListItemClick(ListView l, View v, int position, long id) {
'Approach: if listview1 is clicked then FUNCTION1() else FUNCTION2()'}
thx!
The first parameter to onListItemClick()
is the ListView
.
Also, since only one ListView
will be handled by ListActivity
(and therefore routed to onListItemClick()
), your other ListView
will have a dedicated OnItemClickListener
.
精彩评论