安卓错误积累

android.content.res.Resources$NotFoundException: String resource ID

TextView 有个setText(int reid) 方法,如果我们从网络上获取到的数据是int 不是String 然后就调用了如下的方法:这个时候不会提示错误,在运行的时候回找不到资源报错。素颜要检查下类型。 

text.setText(info.getCnt());

参考:https://blog.csdn.net/owenchan1987/article/details/72824096

猜你喜欢

转载自blog.csdn.net/dianziagen/article/details/80763856