android.content.res.Resources$NotFoundException: String resource ID #0xe错误处理

来源:互联网 发布:如何申请淘宝网开店 编辑:程序博客网 时间:2024/06/08 16:03
在开发中遇到了这个错误 android.content.res.Resources$NotFoundException: String resource ID #0xe at android.content.res.Resources.getText(Resources.java:244) at android.widget.TextView.setText(TextView.java:3888)跟进去找了TextView.setText(int resid);这个方法,才发现如果直接给这个方法传入个int 类型的参数的话会调用这个方法不会去调用我们期望的那个CharSequence参数的方法,传入int 的话会去资源文件中找和这个resid对应的资源文件,肯定是没有的 所以就会报这个错误。
0 0