android.content.res.Resources$NotFoundException: String resource ID #0x7b
来源:互联网 发布:杭州网络安防招聘 编辑:程序博客网 时间:2024/06/14 12:20
原因:一般发生在参数 int resId 错误,你把String赋值给int的resId,所以编译器找不到正确的resource于是报错。
最简单的例子,检查一下你的Toast.makeText()啊textView.setText啊之类的函数,这种函数通常有几个重载,如:
textView.setText(CharSequence text);
textView.setText(int resId);
......
如果不小心将一个int值传给了它,那它不会显示该int值,而是跑到工程下去找一个对应的resource的id,当然是找不到的,于是就报错啦。
解决办法:
如果要显示该int值,就要将int转化成String或者CharSequenc,
在该int值后面+"",强制转为String。
自行百度其他方法
0 0
- android.content.res.Resources$NotFoundException: String resource ID #0x7b
- android.content.res.Resources$NotFoundException: String resource ID #0x6d
- android.content.res.Resources$NotFoundException:String resource ID #0x86
- android.content.res.Resources$NotFoundException: String resource ID #0x1
- android.content.res.Resources$NotFoundException: String resource ID #0x0
- android.content.res.Resources$NotFoundException: String resource ID #0x0
- android.content.res.Resources$NotFoundException: String resource ID #0x7f050016
- android.content.res.Resources$NotFoundException:String resource ID #0x86
- android.content.res.Resources$NotFoundException:String resource ID #0x446
- android.content.res.Resources$NotFoundException: String resource ID #0x1
- android.content.res.Resources$NotFoundException: String resource ID #0x1
- android.content.res.Resources$NotFoundException: String resource ID #0x1
- android.content.res.Resources$NotFoundException: String resource ID #0x42
- android.content.res.Resources$NotFoundException: String resource ID #0x0
- android.content.res.Resources$NotFoundException: String resource ID #0x1
- android.content.res.Resources$NotFoundException: String resource ID #0x0
- android.content.res.Resources$NotFoundException: String resource ID #0x1
- android.content.res.Resources$NotFoundException: String resource ID #0x3
- STM32 GPIO_2 8种工作方式
- C++ 函数后加const
- 切换eclipse package explorer字体大小
- iOS-C语言-C语言的介绍以及第一个例子HelloWorld
- const成员函数、const类对象、mutable数据成员
- android.content.res.Resources$NotFoundException: String resource ID #0x7b
- Android开发中webView与HTML+JS的交互
- PC管理端及评委手机打分端的浏览器兼容问题
- HDU 1753 大明A+B
- iOS-沙盒机制-整合篇
- mysql如何处理auto_increment
- 芯片启动过程 ARM C51 Soc - RTOS LINUX - 之一
- CardView的学习
- iOS9 新特新介绍