Android报android.content.res.Resources$NotFoundException: String resource ID xxx 错误
来源:互联网 发布:3dmax专业优化修改器 编辑:程序博客网 时间:2024/06/09 14:30
Android报“android.content.res.Resources$NotFoundException: String resource ID xxx”错误
错误情形
使用TextView
的setText
方法,报错资源找不到。
.setText(R.id.read_num,item.getReadNum())
解决
这里item.getReadNum()
是一个int,setText
方法如果直接穿一个数字参数,会被当作是资源id,定位该资源发现找不到就会爆粗。所以只要转成字符串就可以了。
.setText(R.id.read_num, “” + item.getReadNum())
阅读全文
0 0
- Android报android.content.res.Resources$NotFoundException: String resource ID xxx 错误
- Android报“android.content.res.Resources$NotFoundException: String resource ID #0x2”错误
- android.content.res.Resources$NotFoundException: Resource ID XXX问题解决
- android:android.content.res.Resources$NotFoundException: String resource ID #..
- 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
- java——斗地主
- [2017集训队作业自选题#119]众数MAX
- UGUI ScrollRect完美使用
- 【Python】numpy中argsort函数的使用
- [javase]抽象类执行构造方法顺序知识点
- Android报android.content.res.Resources$NotFoundException: String resource ID xxx 错误
- 有一个字符数组的内容为:"student a am i",请你将数组的内容改为"i am a student". 要求: 不能使用库函数。只能开辟有限个空间(空间个数和字符串的长度无关)。
- 浅谈MySQL中优化sql语句查询常用的30种方法
- turtlebot_navigation参数配置
- 我的简历和个人陈述
- 再看卷积
- stl traits 萃取特征技术
- JAVA对话框JOptionPane和JDialog的用法
- Git 初接触 (五) Git合并冲突的解决