Onclicklistener acts weird after scrolling in ScrollView

I have many ImageViews installed with OnClickListeners. They go beyond the screen contained in ScrollView. When scrolling down and clicking on an ImageView that was previously off-screen, the onClick (view of the view) does not seem to be executed until the second click. Otherwise, it behaves normally.

My activity implements OnClickListener and uses overridden onClick (View view).

What's happening? Is this a problem with touch mode?

Thank!

UPDATE: The problem I am facing is similar to this bug report: http://code.google.com/p/android/issues/detail?id=11357 . Works like in Eclair, not Froyo.

+3
source share
1 answer

The first click probably indicates focus on your image, and the second actually clicked it. This is likely because the scrollview focuses when scrolling. I'm not sure, but you can try installing focusable(false)in scrollview. I'm not sure if this would be useless with scrolling.

+2
source

Source: https://habr.com/ru/post/1770652/