Why my OnLongClickListener is not working?

Ask by : Luis A. Florit November 04, 2012 13:57

I want to show the EXIF of a picture when I perform a long click over it. So I implemented this:

    picture.setOnLongClickListener(new OnLongClickListener() { 
        public boolean onLongClick(View v) {
            return true;

Problem is that the code is not executed. I added android:longClickable="true" into the xml, without success.

Funny thing is that it works for OnClick, but it doesn't for OnLongClick... Maybe it has to do with the fact that my picture is and extension of ImageView, the (very nice!) class TouchImageView here:


What am I doing wrong??


View original question

Answer by : vasartNovember 04, 2012 13:57

TouchImageView in OnTouchListener always calls return true; (line 112 in file). That's why OnLongClickListener is not working.

View original answer