出现异常:addView(View, LayoutParams) is not supported in AdapterView
检查3个地方:
1.
//参数2 是展现方式,参照http://developer.android.com/reference/android/R.layout.html
//参数3 是定义的数组
setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, this.texts));
如:
//展示的文字
private String[] texts=new String[]{"天气","我团","背景"};
2.
LayoutInflater.from(mContext).inflate(R.layout.second, null); //第二个参数设置为null
3. 布局文件,<ListView> </ListView> 之间不要有任何节点
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="@+id/LinearLayoutAR"
>
<ListView
android:id="@android:id/list"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</ListView>
<TextView android:id="@+id/content_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/content_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout >