getMenuInflater().inflate unreachable statement
来源:互联网 发布:网络没问题起凡打不开 编辑:程序博客网 时间:2024/05/20 16:40
https://stackoverflow.com/questions/46666987/getmenuinflater-inflater-menu-my-menu-menu-error-unreachable-statement
写菜单的时候照代码打的
getMenuInflater().inflate(R.menu.main,menu);报错unreachable
看了上面网站是重写方法时附带的return super.onCreateOptionsMenu(menu);没有注意到直接在下面写代码了。。。
然后应该是这样:不想点开网站看这儿
@Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.main, menu); return super.onCreateOptionsMenu(menu); }
阅读全文
0 0
- getMenuInflater().inflate unreachable statement
- unreachable statement
- unreachable statement
- Unreachable statement错误
- statement is unreachable 的问题
- Android 编译错误:unreachable statement
- Android 编译错误:unreachable statement
- keil提示:statement is unreachable
- java 出现unreachable statement异常
- Android 编译错误:unreachable statement
- IAR编译出现“statement is unreachable”
- Keil-arm警告 warning: : statement is unreachable
- 会出现unreachable statement的可能
- MDK警告 warning: #111-D: statement is unreachable
- Unreachable catch block for IOException. This exception is never thrown from the try statement body
- Unreachable catch block for SQLException. This exception is never thrown from the try statement body
- inflate
- inflate
- M
- 调用系统相册和调用相机
- java-List(Vector)
- java项目在windows和linux下传递json数据不乱码问题
- 几条判断Linux服务器是否被入侵的技巧
- getMenuInflater().inflate unreachable statement
- 关于“天价房的分析”
- Mybatis 连表查询,返回结果封装为Map
- 脑洞大开的插画师,每幅都戳到我诡异的笑点
- 浮点处理器的威力
- flex 图表ColumnChart能够点击数据获得该数据x轴,与y轴坐标
- AS不能创建安卓工程问题
- 操纵文件类
- Java_Map常见方法