InflateException: Couldn't resolve menu item onClick handler

后端 未结 7 795
情书的邮戳
情书的邮戳 2020-12-08 19:12

I asked this question 6 years ago. In the meantime Android development best practices have changed, and I have become a better developer.

Since then, I have realized

7条回答
  •  悲&欢浪女
    2020-12-08 20:00

    Your method must accept a MenuItem as its only parameter per here.

        public void onMenuItemClickMethod(MenuItem menuItem){
            // Do stuff here
        }
    

提交回复
热议问题