1

I'm getting the following suggestion on my ouTouch() function:

enter image description here

why is this?

2
  • are you overriding onTouch only? or creating a whole new custom view?
    – tamtom
    May 19, 2019 at 8:28
  • overriding onTouch only
    – Zorgan
    May 19, 2019 at 8:29

2 Answers 2

1

if you are overriding onTouch listener and you are not calling performClick when clicks are detected, the View may not handle accessibility actions properly. Logic handling the click actions should ideally be placed in View#performClick as some accessibility services invoke performClick when a click action should occur. so to get rid of the warning you have to call v.performClick();

MotionEvent.ACTION_UP:
        v.performClick();
        break;

or

@SuppressLint("ClickableViewAccessibility")
0

The easiest way is suppress a warning

@SuppressLint("ClickableViewAccessibility")

or call performClick()

[Example]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.