Your content must have a Listview whose id attribute is 'android.R.id.list'

来源:互联网 发布:百度大数据标注平台 编辑:程序博客网 时间:2024/06/05 11:58

java.lang.RuntimeException: Unable to start activity ComponentInfo {com.ranger.issueanalysis/com.ranger.issusanalysis.SearchActivity } : java.lang.RuntimeException : Your content must have a Listview whose id attribute is 'android.R.id.list'


The reason is the Activity extends ListActivity, so the layout file must have a Listview and it's id is list,

<ListView  android:id="@+id/@android:id/list"  android:layout_width="match_parent"  android:layout_height="wrap_content" ></ListView>

I don't know why, but only in this way the activity can run.

0 0
原创粉丝点击