关于setText()方法报android.content.res.Resources$NotFoundException: String resource ID #0x0 找不到资源文件ID #0x

android.content.res.Resources$NotFoundException: String resource ID #0x0 找不到资源文件ID #0x0

原因分析如下:

遇到这种情况,很有可能是把一个int型业务数据的 设置setText()或者类似的方法中, 这样Android系统就会主动去资源文件当中寻找, 但是它不是一个资源文件ID, 所以就会报出这个bug。 将int型业务数据,转换成String类型即可。

猜你喜欢

转载自blog.csdn.net/dadaima/article/details/80394848