美文网首页
Resources$NotFoundException: Str

Resources$NotFoundException: Str

作者: 搬砖小工人 | 来源:发表于2016-12-26 16:01 被阅读0次
android.content.res.Resources$NotFoundException: String resource  ID #0x1
at android.content.res.Resources.getText(Resources.java:1437)
at android.widget.TextView.setText(TextView.java:4965)
...

错误分析如下:
     是因为 把一个 非 String 型的参数赋值给了 text。
     比如 :setText(1) 在代码编辑中是不会显示错误的,但是运行时会崩溃,报出以上错误;
     将其修改为 setText("1"),就不会报错了。
错误锦囊记录(1)

相关文章

网友评论

      本文标题:Resources$NotFoundException: Str

      本文链接:https://www.haomeiwen.com/subject/yjbjvttx.html