is there any possibility to detect a click on an ImageView with a Handler (eg looking at it for 100 ms)? I mean is there a method of ImageView/View, which give me a boolean when someone has the finger on the ImageView?
Thank you!
EDIT: For all people in interest for an deep understanding: https://www.youtube.com/watch?v=SYoN-OvdZ3M&t=139s That are 4 videos about the thematic. After this all my questions was answered.
If you want to detect whether the user has his finger on the imageview, you can use setOnTouchListener
,
imageview.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent e) {
if (e.getActionMasked() == MotionEvent.ACTION_DOWN) {
// This is a touch action.
}
}
Other actions include ACTION_UP, ACTION_MOVE etc. Depending on what you want, you can trigger the click action by choosing the right touch event.