这个错误提示很显然是在setContentView(R.layout.main)的地方设置的布局页面缺少一个id为android.R.id.list的ListView控件,解决方式如下:
在main.xml页面中添加如下代码:
<ListView android:id="[color=red]@android:id/list[/color]"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</ListView>
在main.xml页面中添加如下代码:
<ListView android:id="[color=red]@android:id/list[/color]"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</ListView>
本文介绍了一种常见的Android应用开发中的错误——布局文件中缺失id为android.R.id.list的ListView组件,并提供了解决方案,即在main.xml布局文件中加入正确的ListView定义。
588

被折叠的 条评论
为什么被折叠?



