android.content.res.Resources$NotFoundException: String resource ID #0x0异常
来源:互联网 发布:python中pipy 编辑:程序博客网 时间:2024/06/11 18:42
今天遇到这个异常找了好久,android.content.res.Resources$NotFoundException: String resource ID #0x0
代码语法上没有报错,但是在运行时候出错了,后来发现
void android.widget.TextView.setText(CharSequence text)
void android.widget.TextView.setText(resid id)
方法重载,如果传入的是一个int型的数据,但又不是资源文件的id,所以有在资源文件中找不到,就会报找不到资源id的异常。我的解决方案是:
setText(1+"");就可以将int型的转换成String类型的,就不会将认为是资源文件的id了
1 0
- 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 #0x0
- 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 #0x0
- # 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 #0x0
- android.content.res.Resources$NotFoundException: String resource ID #0x0
- android.content.res.Resources$NotFoundException: String resource ID #0x0异常
- TextView异常:android.content.res.Resources$NotFoundException: String resource ID #0x0
- android.content.res.Resources$NotFoundException: String resource ID #0x0 找不到资源文件ID #0x0
- android.content.res.Resources$NotFoundException: String resource ID #0x0 找不到资源文件ID #0x0
- android.content.res.Resources$NotFoundException: String resource ID #0x0 找不到资源文件ID #0x0
- android.content.res.Resources$NotFoundException: String resource ID #0x0 找不到资源文件ID #0x0
- android.content.res.Resources$NotFoundException: Resource ID #0x0,错误
- android.content.res.Resources$NotFoundException: Resource ID #0x0
- Apache配置——监听多个端口 对应多个不同的网站目录
- 操作系统中的页面置换算法
- hdu 2803 The MAX【贪心】
- 容斥基础
- linux shell用法(4)-- shell逻辑符号与c兼容方法
- android.content.res.Resources$NotFoundException: String resource ID #0x0异常
- 数据库小析
- Spring AOP
- spring 注解方式配置Bean
- MYSQL的文件排序(filesort)和索引排序
- hdu 1495 非常可乐【bfs】
- 【JDK源码】从JDK/ArrayList源码学习高质量代码
- spring boot实战(第十一篇)初识RabbitMQ
- 【Unity3D游戏开发学习笔记】(六)上帝之手—GameObject的操作