I am trying create an OnTouchListener
to my editText
("search").
I took the code from post : Click listener for drawableleft in EditText in Android?
(Along with other posts) I am getting an error saying
Custom view EditText has set OnTouchListener called on it but does not override PerformClick
Not quite sure where to go from here, as there is not much written about this that I can find. Thanks from your help!
search.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
final int DRAWABLE_LEFT = 0;
if(event.getX() <= (search.getCompoundDrawables()[DRAWABLE_LEFT].getBounds().width()))
{
// your action here
return true;
}
return false;
}
});
Thanks