我出现这个问题是引用资源文件问题
helper.getView(R.id.in_pic).setBackgroundResource(item.getResourceId()); //错的
helper.getView(R.id.in_pic).setBackground(getResources().getDrawable(item.getResourceId()));//对的
The content of the adapter has changed but ListView did not receive a notification. Make sure the co...
最新推荐文章于 2025-03-18 10:00:01 发布
本文解决了在Android应用开发中遇到的一个常见问题:如何正确设置视图的背景资源。通过对比错误和正确的代码示例,文章详细解释了应当使用哪种方法来避免运行时异常。
1669

被折叠的 条评论
为什么被折叠?



