java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView

在各类Adapter中,比如ListView需要数据时我们会加载相关的数据,用到BaseAdapter。解决办法:


   //出错情况
    convertView = inflater.inflate(R.layout.test_layout,parent,true);
   //正确做法
   convertView = inflater.inflate(R.layout.test_layout,parent,false);
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容