开发者

What does this error mean regarding the ID of my ListView?

开发者 https://www.devze.com 2023-01-31 00:40 出处:网络
The error below occurs when I try to run my program. Can anyone tell me what it means? ERROR/AndroidRunt开发者_JAVA技巧ime(707): Caused by:

The error below occurs when I try to run my program. Can anyone tell me what it means?

ERROR/AndroidRunt开发者_JAVA技巧ime(707): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'


Well, it's right there in plain English. I will copy and paste it: Your content must have a ListView whose id attribute is 'android.R.id.list'

Basically, in your XML file that describes your layout, you need to create a ListView with an ID defined as "@id/android:list". The Android API will automatically find this view and use it for your list activity.

This is incidentally explained in detail in the documentation for ListActivity: http://developer.android.com/reference/android/app/ListActivity.html

0

精彩评论

暂无评论...
验证码 换一张
取 消