cocos2d-x安卓调试 android.content.res.Resources$NotFoundException: String resource ID #0x0
来源:互联网 发布:mac电脑怎么压缩文件 编辑:程序博客网 时间:2024/06/02 21:50
做Android应用开发的朋友有时候会遇到这样的Bug,,
android.content.res.Resources$NotFoundException: String resource ID #0x0 找不到资源文件ID #0x0
原因分析如下:
由于result是init型,这样调用就会报错
android.content.res.Resources$NotFoundException: String resource ID #0x0 找不到资源文件ID #0x0
原因分析如下:
遇到这种情况,很有可能是把一个int型业务数据的 设置setText()或者类似的方法中, 这样Android系统就会主动去资源文件当中寻找, 但是它不是一个资源文件ID, 所以就会报出这个bug。 将int型业务数据,转换成String类型即可。
例如:
int result = 0;Toast.makeText(this, result, Toast.LENGTH_LONG).show();
由于result是init型,这样调用就会报错
0 0
- cocos2d-x安卓调试 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
- 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
- android.content.res.Resources$NotFoundException: Resource ID #0x0
- 【HDU】 1026 Ignatius and the Princess I
- 二叉树创建-思路
- JAVA并发处理经验(四)并行模式与算法6:socket的服务端多线程
- 30分钟学会正则
- 当讨论分布式系统时,我们都会讨论些什么?
- cocos2d-x安卓调试 android.content.res.Resources$NotFoundException: String resource ID #0x0
- 自我学习之KMP算法
- iOS调用系统相册、相机 显示中文标题
- Windows消息机制要点
- Laravel Homestead 使用
- LeetCode 326 Power of Three(3的幂)(递归、Log函数)
- SSH——Hibernate初学者之旅(四)
- Java中为什么字段不能被重写
- ElasticSearch Java API