运行时异常必须包括属性为android.R.id.list的listview
我的程序包含一个用于检索数据库数据的列表视图。但代码不起作用。下面给出了xml文件和logcat。请帮助我。 我的程序包含一个用于检索数据库数据的列表视图。但代码不起作用。下面给出了xml文件和logcat。请帮助我 activity_first.xml运行时异常必须包括属性为android.R.id.list的listview,android,listview,Android,Listview,我的程序包含一个用于检索数据库数据的列表视图。但代码不起作用。下面给出了xml文件和logcat。请帮助我。 我的程序包含一个用于检索数据库数据的列表视图。但代码不起作用。下面给出了xml文件和logcat。请帮助我 activity_first.xml 每个ListActivity在其布局定义中都需要一个默认ListView id,因此,您可以使用以下id代替ListView id: <ListView android:id="@+id/list" android:layout
每个ListActivity在其布局定义中都需要一个默认ListView id,因此,您可以使用以下id代替ListView id:
<ListView android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
使用:
每个ListActivity在其布局定义中都需要一个默认的ListView id,因此,您需要:
<ListView android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
使用:
从文档中引用
ListActivity具有由单个,
屏幕中央的全屏列表。但是如果你愿意的话,,
您可以通过设置自己的视图布局来自定义屏幕布局
在onCreate()中使用setContentView()。要做到这一点,你必须有自己的观点
包含一个id为“@android:id/list”的ListView对象(如果需要,则为list)
它在代码中)
将以下内容添加到xml格式的listview
<ListView android:id="@android:id/list"
从文件中引用
ListActivity具有由单个,
屏幕中央的全屏列表。但是如果你愿意的话,,
您可以通过设置自己的视图布局来自定义屏幕布局
在onCreate()中使用setContentView()。要做到这一点,你必须有自己的观点
包含一个id为“@android:id/list”的ListView对象(如果需要,则为list)
它在代码中)
将以下内容添加到xml格式的listview
<ListView android:id="@android:id/list"
改变
<ListView android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
为此:
<ListView android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
在XML文件中。希望能有所帮助。改变
<ListView android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
为此:
<ListView android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
在XML文件中。希望能有所帮助。@HossamOukli op有这个
@HossamOukli op有这个你问了11个问题都没有接受?没有一个答案对你有帮助吗?你问了11个问题,没有一个被接受?没有一个答案对你有帮助吗?我不知道!也许是因为你对另一个问题的评论,我认为答案没有任何错误,我投了更高的票。我会删除我的评论谢谢你无论如何我也删除了答案;)@拉古南丹:这被我否决了,因为@id/android:list
是错误的。它应该是@android:id/list
@Arash。检查id部分下的主题我不知道!也许是因为你对另一个问题的评论,我认为答案没有任何错误,我投了更高的票。我会删除我的评论谢谢你无论如何我也删除了答案;)@拉古南丹:这被我否决了,因为@id/android:list
是错误的。它应该是@android:id/list
@Arash。检查id部分下的主题“你错了,一定是你错了,一定是
<ListView android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<ListView android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />