OnLongClickListener never gets a trigger

I have a custom listView defined as

public class DDListView extends ListView implements OnScrollChangedListener { 

what am I doing an instance of it called mExampleList I set onLongClickListener, but it never gets called, where is my problem?

 mExampleList.setOnLongClickListener(new OnLongClickListener() { public boolean onLongClick(View v) { // TODO Auto-generated method stub Log.v("vvv", "sdfsdf"); return false; } }); 
+7
source share
2 answers

I think you want to use OnItemLongClickListener instead of OnClickListener .

+10
source

Mmmmm, are you trying to make all ListView longclckeable?

Some tips:

- first check if the usual OnClick is running;

-Try if you have setClickeable (true); On him;

-Try to see if you are really trying to do this, and not the usual onItemClick () of the items in the list (to do this, run the @override command:
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {}

0
source

All Articles