when I use the setOnTouchListener on a button, when I overwrite the onTouch method it tells me this
Custom View ImageView has setOnTouchListener enabled but does not replace performClick If a view that overrides onTouchEvent or uses an OnTouchListener does not also implement performClick and calls it when clicks are detected, the view may not handle accessibility actions correctly. The logic that handles click actions should ideally be placed in View # performClick since some accessibility services invoke performClick when a click action should occur
I have searched for everything and I can not find how to remove the warning.
This is my code:
boton_w.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if(motionEvent.getAction() == MotionEvent.ACTION_DOWN){
boton_w.setElevation(2);
}else if(motionEvent.getAction() == MotionEvent.ACTION_UP){
boton_w.setElevation(10);
}
return true;
}
});
That's how the warning marks me