Question

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() {

        public boolean onLongClick(View v) {
            // TODO Auto-generated method stub
            Log.v("vvv", "sdfsdf");
            return false;
        }
    });
Was it helpful?

Solution

I think you want to be using OnItemLongClickListener instead of OnClickListener.

OTHER TIPS

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) {}

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top