Custom view 'ImageButton' has setOnTouchListener called on it but does not override performClick

后端 未结 3 1939
情歌与酒
情歌与酒 2021-01-07 18:31

Well, I know there are some questions regarding this warning, but i still cannot figure out how to get rid of this. I don\'t want to implement the OnTouchListener

3条回答
  •  旧巷少年郎
    2021-01-07 19:27

    Change your this line of code

    View.performClick ();
    

    TO

    send.performClick ();
    

    And add this override method at the end of you activity.

    @Override
    public boolean performClick() {
    // do what you want
    return true;
    }
    

    Hope that helps

提交回复
热议问题