onLongClickListener never get trigered
I have a custom listView defined like this
public class DDListView extends ListView implements OnScrollChangedListener {
than I make an instance of it with name mExampleList I set onLongClickListener but it never get called, where is my problem ?
mExampleList.setOnLongClickListener(new OnLongClickListener()开发者_StackOverflow中文版 {
public boolean onLongClick(View v) {
// TODO Auto-generated method stub
Log.v("vvv", "sdfsdf");
return false;
}
});
I think you want to be using OnItemLongClickListener instead of OnClickListener
.
Mmmmm , are you trying to make all ListView longclckeable?
Some tips:
-Try first to see if normal OnClick gets fired;
-Try to see if you have setClickeable(true); on it;
-Try to see if you are really trying to do that and not an usual onItemClick() of the items in the list (to do this @override the function :
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {}
精彩评论