pvn
pvn

Reputation: 2116

ImageView onClick() and fling() gesture clashing

I have an activity in which i have set an imageView. OnFling i load another image and onClick on the image i have to go to another activity.

Now the problem is that when i try to fling/swipe on the imageView its onClick is called so fling() is not executed. How to resolve this. Thanks in advance

Upvotes: 1

Views: 377

Answers (2)

pvn
pvn

Reputation: 2116

you can give onClick() to all other views do nothing in them. Now in onSingleTapUp() write the imageView's onClick() body

Upvotes: 0

the-ginger-geek
the-ginger-geek

Reputation: 7081

Rather use the onTouchEvent in the GestureDetector class to do the work of your onClick method. You can use the MotionEvent actions to determine if it was a click or not.

Upvotes: 1

Related Questions