What does this error mean regarding the ID of my ListView?
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
精彩评论