Input cancellation - Android
On Android, you should avoid using the ACTION_DOWN
event of OnTouchListener
, because users will not be able to cancel their interaction. Actions should only be activated through an ACTION_UP
event. Use an OnClickListener
instead, because it has built-in support for cancellation.
webView.setOnTouchListener { _, event ->
if (event == MotionEvent.ACTION_DOWN) {
// Use OnClickListener instead
}
}