Fragment implements OnClickListener

后端 未结 4 852
醉话见心
醉话见心 2020-12-29 06:19

I\'ve got an application that I\'m modernizing. One step of this process is changing to a Fragment based layout (using the Fragments from the support library). I converted m

4条回答
  •  爱一瞬间的悲伤
    2020-12-29 07:01

    I want to comment on Abhijit Chakra answer but it seems that I need to have 50 reps for that. For those who are wondering if you can't use Abhijit's answer, it is because of:

    public void OnClick(View v) {
        // implements your things
    }
    

    You need to make sure that it is onClick, NOT OnClick. Thankfully Android Studio internal error message come to rescue.

提交回复
热议问题