Skip to content

Latest commit

 

History

History
11 lines (9 loc) · 779 Bytes

File metadata and controls

11 lines (9 loc) · 779 Bytes

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
    }
}