-6
08-22 15:28:41.848: E/Trace(678): error opening trace file: No such file or directory (2)
08-22 15:28:42.387: D/AndroidRuntime(678): Shutting down VM
08-22 15:28:42.387: W/dalvikvm(678): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
08-22 15:28:42.407: E/AndroidRuntime(678): FATAL EXCEPTION: main
08-22 15:28:42.407: E/AndroidRuntime(678): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vikram.custummenuactivity/com.vikram.custummenuactivity.CustumMenuActivity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
08-22 15:28:42.407: E/AndroidRuntime(678):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
08-22 15:28:42.407: E/AndroidRuntime(678):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
08-22 15:28:42.407: E/AndroidRuntime(678):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
08-22 15:28:42.407: E/AndroidRuntime(678):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
08-22 15:28:42.407: E/AndroidRuntime(678):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-22 15:28:42.407: E/AndroidRuntime(678):  at android.os.Looper.loop(Looper.java:137)
08-22 15:28:42.407: E/AndroidRuntime(678):  at android.app.ActivityThread.main(ActivityThread.java:4745)
08-22 15:28:42.407: E/AndroidRuntime(678):  at java.lang.reflect.Method.invokeNative(Native Method)
08-22 15:28:42.407: E/AndroidRuntime(678):  at java.lang.reflect.Method.invoke(Method.java:511)
08-22 15:28:42.407: E/AndroidRuntime(678):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-22 15:28:42.407: E/AndroidRuntime(678):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-22 15:28:42.407: E/AndroidRuntime(678):  at dalvik.system.NativeStart.main(Native Method)
08-22 15:28:42.407: E/AndroidRuntime(678): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
08-22 15:28:42.407: E/AndroidRuntime(678):  at android.app.ListActivity.onContentChanged(ListActivity.java:243)
08-22 15:28:42.407: E/AndroidRuntime(678):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:259)
08-22 15:28:42.407: E/AndroidRuntime(678):  at android.app.Activity.setContentView(Activity.java:1867)
08-22 15:28:42.407: E/AndroidRuntime(678):  at com.vikram.custummenuactivity.CustumMenuActivity.onCreate(CustumMenuActivity.java:24)
08-22 15:28:42.407: E/AndroidRuntime(678):  at android.app.Activity.performCreate(Activity.java:5008)
08-22 15:28:42.407: E/AndroidRuntime(678):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
08-22 15:28:42.407: E/AndroidRuntime(678):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
08-22 15:28:42.407: E/AndroidRuntime(678):  ... 11 more
08-22 15:33:42.558: I/Process(678): Sending signal. PID: 678 SIG: 9
4

2 回答 2

1

所以问题不应该是棘手的。你的问题是:

原因:java.lang.RuntimeException:您的内容必须有一个 id 属性为 'android.R.id.list' 的 ListView

这意味着你ListView应该有 id 属性android.R.id.list

<ListView
   android:id="@android:id/list"
   ...
/>

类似主题:

于 2012-08-22T16:08:06.173 回答
0

从您的堆栈跟踪中:“您的内容必须有一个 id 属性为 'android.R.id.list”的 ListView。将此 id 添加到 XML 布局文件中的适当元素,例如:

于 2012-08-22T15:59:56.387 回答