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);

你可能感兴趣的:(java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView)