diff --git a/library/src/main/java/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.java b/library/src/main/java/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.java index 56a6b5ee..40874a93 100755 --- a/library/src/main/java/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.java +++ b/library/src/main/java/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.java @@ -292,7 +292,7 @@ public SubsamplingScaleImageView(Context context, AttributeSet attr) { setGestureDetector(context); this.handler = new Handler(new Handler.Callback() { public boolean handleMessage(Message message) { - if (message.what == MESSAGE_LONG_CLICK && onLongClickListener != null) { + if (message.what == MESSAGE_LONG_CLICK && onLongClickListener != null && isLongClickable()) { maxTouchCount = 0; SubsamplingScaleImageView.super.setOnLongClickListener(onLongClickListener); performLongClick(); @@ -2856,6 +2856,9 @@ public boolean hasImage() { */ @Override public void setOnLongClickListener(OnLongClickListener onLongClickListener) { + if (!isLongClickable()) { + setLongClickable(true); + } this.onLongClickListener = onLongClickListener; }