错误记录:Resource ID #0x7f040006 type #0x12 is not valid
来源:互联网 发布:php数据库管理系统 编辑:程序博客网 时间:2024/06/10 08:48
今天学习SlidingMenu遇到这个问题,记录一下。
报错为:
E/AndroidRuntime(666): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.usingslidingmenu/com.example.usingslidingmenu.MainActivity}: android.content.res.Resources$NotFoundException: Resource ID#0x7f040006 type #0x12 is not valid
查了一下,在R.java中查到#0x7f040006是slidingmenu
程序中是这样调用的:
slidingMenu.setMenu(R.id.slidingmenu);
正确方法应该这样:
slidingMenu.setMenu(R.layout.sliding_menu);
报错的slidingmenu只是layout.sliding_menu中的一个组件,此处看着像是一个set属性的方法,但应该传入layout资源;另外布局id和其中的组件id太相似也是导致错误的一个原因,以后应该注意。
0 0
- 错误记录:Resource ID #0x7f040006 type #0x12 is not valid
- Resource ID #0x7f050001 type #0x12 is not valid
- Resource ID #0x7f0d00bb type #0x12 is not valid
- android.content.res.Resources$NotFoundException:Resource ID #0x7f080004 type #0x12 is not valid问题解决
- android.content.res.Resources$NotFoundException: Resource ID #0x7f09000a type #0x12 is not valid
- Android运行时android.content.res.Resources$NotFoundException: Resource ID #0x7f0f00b3 type #0x12 错误
- JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal continuation byte 0x12
- VS2005中CSCx.tmp is not a valid Win32 resource file错误的解决办法
- curl发送请求时出现Warning: curl_error(): 2 is not a valid cURL handle resource错误
- 关于conversion from string to type date is not valid错误
- 错误Resources$NotFoundException: Resource ID #0x7f080004
- Error: ' ' is not a valid resource name character
- curl_exec(): 2 is not a valid cURL handle resource
- 问题:Error: ' ' is not a valid resource name character
- Can't convert to dimension: type=0x12
- Can't convert to dinmension:type = 0x12
- Can't convert to dimension: type=0x12问题
- 错误 Error: Expected resource of type id [ResourceTyp]
- Hibernate学习篇05——联合主键(二)
- thinkphp3.2.3开发商城实战(一)
- 栈与队列
- 深入探讨 Java 类加载器
- *LeetCode 90
- 错误记录:Resource ID #0x7f040006 type #0x12 is not valid
- 网易公开课《Linux内核分析》学习心得-mykernel实验的实践和分析
- 一对多 pc上运行android客户端
- [DevExpress]ASP.NET動態設定XtraReport報表參數的方式 5715 ASP.NET 檢舉文章 在ASP.NET中要如何動態設定XtraReport報表參數,或
- TCP
- 文章标题
- iOS/OS X内存管理(一):基本概念与原理
- Android UI学习 - FrameLayou和布局优化
- c++静态断言的实现方式 编译器遇除数为0报错