More specific where do I attach OnGestureListener
so that
I can detect onSingleTapUp
everywhere on the screen,
even if an ImageView>
I'm answering this for those who just need a simple way to detect a tap on the screen:
Add an android:onClick
value to your base/root layout (LinearLayout, RelativeLayout, etc.). You can call it anything you want, I'm naming it screenTapped
as an example:
Add this method to your Activity
using the same name you specified for onClick
:
public void screenTapped(View view) {
// Your code here
}
Now, tapping on the screen will call the method above.