android.content.res.Resources$NotFoundException: String resource ID #0x1
来源:互联网 发布:时时彩源码免费下载 编辑:程序博客网 时间:2024/04/30 18:33
【1】错误原代码:randTextView.setText( position+1 );期末在做android项目的时候,出现了这种异常,当时也并没有报编译异常,后来运行就出现下面的运行异常,最后才知道,原来setText()这里出现了问题。改成setText( String.valueOf(position+1) ),这样就不会报运行异常了。虽然写代码的时候没有报编译错误,但是为了程序的健壮性以后最好还是先转换成字符串,然后再设置。
12-11 01:13:07.584: E/AndroidRuntime(3805): android.content.res.Resources$NotFoundException: String resource ID #0x1
12-11 01:13:07.584: E/AndroidRuntime(3805): at android.content.res.Resources.getText(Resources.java:230)12-11 01:13:07.584: E/AndroidRuntime(3805): at android.widget.TextView.setText(TextView.java:3640)
12-11 01:13:07.584: E/AndroidRuntime(3805): at com.cjh.game.jigsawpuzzle.GameDataActivity$1.getView(GameDataActivity.java:73)
0 0
- 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 #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 #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 #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 #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 #0x1
- android.content.res.Resources$NotFoundException: String resource ID #0x1
- android.content.res.Resources$NotFoundException: String resource ID #0x1
- 大数据Hadoop与Spark学习经验谈
- redis集群搭建
- 【设计模式 - 15】之解释器模式(Interpreter)
- MainActivity 通过广播接收 IntentService传过来的数据
- 用javase写一个简单的生成验证码图片的程序(verification code)
- android.content.res.Resources$NotFoundException: String resource ID #0x1
- 一步步通过命令行cl.exe编译Windows程序
- 缓存使用中Redis,Memcached的共性和差异分析
- webpack 配置总结
- (奇怪的暴力)codeforces 731F 354C
- 152.Maximum Product Subarray
- 预处理标识符
- 利用nginx 反向代理解决跨域问题
- Spring中的代理模式