Skip to content Skip to sidebar Skip to footer

How To Use Long Press In Android Custom Imageview?

I am using custom imageview for zoom in image. zoom in and zoom out works well but i need to tap for long click listener to handle this but i couldn't use , long click listener. I

Solution 1:

Try to use this:

http://developer.android.com/reference/android/view/View.html#setLongClickable(boolean)

on your TouchImageView.

Solution 2:

Found solution:

@OverridepublicbooleanonTouch(View v, MotionEvent event) {
   booleandefaultResult= v.onTouchEvent(event); // use thiscase MotionEvent.ACTION_POINTER_UP:
                    mode = NONE;
                    break;                        
                    default:
                    return defaultResult;
            }
            setImageMatrix(matrix);
            invalidate();
            returntrue;

Post a Comment for "How To Use Long Press In Android Custom Imageview?"