码迷,mamicode.com
首页 > 移动开发 > 详细

Android报“android.content.res.Resources$NotFoundException: String resource ID #0x2”错误

时间:2018-05-11 20:15:38      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:解决方法   text   div   and   ext   otf   str   oid   resources   

Android报“android.content.res.Resources$NotFoundException: String resource ID #0x2”错误

当调用setText()方法时如果传入int型是不会被当成内容而是resourceID来使用!

所以报错!

解决方法:TextView.setText("" + arg)

转为String传入即可

Android报“android.content.res.Resources$NotFoundException: String resource ID #0x2”错误

标签:解决方法   text   div   and   ext   otf   str   oid   resources   

原文地址:https://www.cnblogs.com/liyanli-mu640065/p/9025347.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
分享档案
周排行
mamicode.com排行更多图片
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!