I get this warning (from the question title) in a custom Android view I am developing.
Why do I get warned? What\'s the logic behind it i.e. why is it a good
pra
The onTouchEvent is not called by some Accessibility services, as explained by clicking the "more..." link in the warning details.
It recommends that you override performClick for your desired action, or at least override it alongside your onTouchEvent.
If your code is more fitting for the touch event, you can use something similar to:
@Override
public boolean performClick() {
if (actionNotAlreadyExecuted) {
MotionEvent myEvent = MotionEvent.obtain(long downTime, long eventTime, int action, float x, float y, int metaState);
onTouch(myView, myEvent);
}
return true; // register it has been handled
}
More information on accessing touch events through code is available at trigger ontouch event programmatically