本文标签: Exception shotting , 汇总
when i try to do setContentView(R.layout.main),in a ListActivity i get an error RunTimeException with message:Your content must have a ListView whose id attribute is 'android.R.id.list'so you must read the docs of ListActivity,it says you should have a ListView with the follow :
这个错误提示是在setContentView(R.layout.main)的地方设置的布局页面缺少一个id为android.R.id.list的ListView控件,
解决方式如下:
在main.xml页面中添加如下代码:
<ListView android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</ListView>
声明: 本文由( 魔豆先生 )原创编译,转载请保留链接: android常见Exception shotting汇总【持续更新…】
Linux系统与内核学习群:194051772
WP建站技术学习交流群:194062106