gpt4 book ai didi

java - LogCat条目含义

转载 作者:行者123 更新时间:2023-12-01 06:55:03 25 4
gpt4 key购买 nike

这是在我的 LogCat 中,我不知道它是什么意思。有人能明白这一点吗?谢谢!

12-26 17:51:04.141: W/dalvikvm(9109): threadid=1: thread exiting with uncaught exception (group=0x40af6300)
12-26 17:51:04.151: E/AndroidRuntime(9109): FATAL EXCEPTION: main
12-26 17:51:04.151: E/AndroidRuntime(9109): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.to_doliste/com.example.to_doliste.MainActivity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
12-26 17:51:04.151: E/AndroidRuntime(9109): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2243)
12-26 17:51:04.151: E/AndroidRuntime(9109): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2278)
12-26 17:51:04.151: E/AndroidRuntime(9109): at android.app.ActivityThread.access$600(ActivityThread.java:142)
12-26 17:51:04.151: E/AndroidRuntime(9109): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
12-26 17:51:04.151: E/AndroidRuntime(9109): at android.os.Handler.dispatchMessage(Handler.java:99)
12-26 17:51:04.151: E/AndroidRuntime(9109): at android.os.Looper.loop(Looper.java:156)
12-26 17:51:04.151: E/AndroidRuntime(9109): at android.app.ActivityThread.main(ActivityThread.java:5099)
12-26 17:51:04.151: E/AndroidRuntime(9109): at java.lang.reflect.Method.invokeNative(Native Method)
12-26 17:51:04.151: E/AndroidRuntime(9109): at java.lang.reflect.Method.invoke(Method.java:511)
12-26 17:51:04.151: E/AndroidRuntime(9109): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-26 17:51:04.151: E/AndroidRuntime(9109): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-26 17:51:04.151: E/AndroidRuntime(9109): at dalvik.system.NativeStart.main(Native Method)
12-26 17:51:04.151: E/AndroidRuntime(9109): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
12-26 17:51:04.151: E/AndroidRuntime(9109): at android.app.ListActivity.onContentChanged(ListActivity.java:250)
12-26 17:51:04.151: E/AndroidRuntime(9109): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:281)
12-26 17:51:04.151: E/AndroidRuntime(9109): at android.app.Activity.setContentView(Activity.java:1897)
12-26 17:51:04.151: E/AndroidRuntime(9109): at com.example.to_doliste.MainActivity.onCreate(MainActivity.java:17)
12-26 17:51:04.151: E/AndroidRuntime(9109): at android.app.Activity.performCreate(Activity.java:4543)
12-26 17:51:04.151: E/AndroidRuntime(9109): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1071)
12-26 17:51:04.151: E/AndroidRuntime(9109): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199)
12-26 17:51:04.151: E/AndroidRuntime(9109): ... 11 more
12-26 17:53:16.211: W/dalvikvm(10189): threadid=1: thread exiting with uncaught exception (group=0x40af6300)
12-26 17:53:16.221: E/AndroidRuntime(10189): FATAL EXCEPTION: main
12-26 17:53:16.221: E/AndroidRuntime(10189): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.to_doliste/com.example.to_doliste.MainActivity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
12-26 17:53:16.221: E/AndroidRuntime(10189): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2243)
12-26 17:53:16.221: E/AndroidRuntime(10189): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2278)
12-26 17:53:16.221: E/AndroidRuntime(10189): at android.app.ActivityThread.access$600(ActivityThread.java:142)
12-26 17:53:16.221: E/AndroidRuntime(10189): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
12-26 17:53:16.221: E/AndroidRuntime(10189): at android.os.Handler.dispatchMessage(Handler.java:99)
12-26 17:53:16.221: E/AndroidRuntime(10189): at android.os.Looper.loop(Looper.java:156)
12-26 17:53:16.221: E/AndroidRuntime(10189): at android.app.ActivityThread.main(ActivityThread.java:5099)
12-26 17:53:16.221: E/AndroidRuntime(10189): at java.lang.reflect.Method.invokeNative(Native Method)
12-26 17:53:16.221: E/AndroidRuntime(10189): at java.lang.reflect.Method.invoke(Method.java:511)
12-26 17:53:16.221: E/AndroidRuntime(10189): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-26 17:53:16.221: E/AndroidRuntime(10189): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-26 17:53:16.221: E/AndroidRuntime(10189): at dalvik.system.NativeStart.main(Native Method)
12-26 17:53:16.221: E/AndroidRuntime(10189): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
12-26 17:53:16.221: E/AndroidRuntime(10189): at android.app.ListActivity.onContentChanged(ListActivity.java:250)
12-26 17:53:16.221: E/AndroidRuntime(10189): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:281)
12-26 17:53:16.221: E/AndroidRuntime(10189): at android.app.Activity.setContentView(Activity.java:1897)
12-26 17:53:16.221: E/AndroidRuntime(10189): at com.example.to_doliste.MainActivity.onCreate(MainActivity.java:17)
12-26 17:53:16.221: E/AndroidRuntime(10189): at android.app.Activity.performCreate(Activity.java:4543)
12-26 17:53:16.221: E/AndroidRuntime(10189): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1071)
12-26 17:53:16.221: E/AndroidRuntime(10189): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199)
12-26 17:53:16.221: E/AndroidRuntime(10189): ... 11 more
12-26 17:56:31.941: W/dalvikvm(12002): threadid=1: thread exiting with uncaught exception (group=0x40af6300)
12-26 17:56:31.951: E/AndroidRuntime(12002): FATAL EXCEPTION: main
12-26 17:56:31.951: E/AndroidRuntime(12002): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.to_doliste/com.example.to_doliste.MainActivity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
12-26 17:56:31.951: E/AndroidRuntime(12002): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2243)
12-26 17:56:31.951: E/AndroidRuntime(12002): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2278)
12-26 17:56:31.951: E/AndroidRuntime(12002): at android.app.ActivityThread.access$600(ActivityThread.java:142)
12-26 17:56:31.951: E/AndroidRuntime(12002): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
12-26 17:56:31.951: E/AndroidRuntime(12002): at android.os.Handler.dispatchMessage(Handler.java:99)
12-26 17:56:31.951: E/AndroidRuntime(12002): at android.os.Looper.loop(Looper.java:156)
12-26 17:56:31.951: E/AndroidRuntime(12002): at android.app.ActivityThread.main(ActivityThread.java:5099)
12-26 17:56:31.951: E/AndroidRuntime(12002): at java.lang.reflect.Method.invokeNative(Native Method)
12-26 17:56:31.951: E/AndroidRuntime(12002): at java.lang.reflect.Method.invoke(Method.java:511)
12-26 17:56:31.951: E/AndroidRuntime(12002): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-26 17:56:31.951: E/AndroidRuntime(12002): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-26 17:56:31.951: E/AndroidRuntime(12002): at dalvik.system.NativeStart.main(Native Method)
12-26 17:56:31.951: E/AndroidRuntime(12002): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
12-26 17:56:31.951: E/AndroidRuntime(12002): at android.app.ListActivity.onContentChanged(ListActivity.java:250)
12-26 17:56:31.951: E/AndroidRuntime(12002): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:281)
12-26 17:56:31.951: E/AndroidRuntime(12002): at android.app.Activity.setContentView(Activity.java:1897)
12-26 17:56:31.951: E/AndroidRuntime(12002): at com.example.to_doliste.MainActivity.onCreate(MainActivity.java:17)
12-26 17:56:31.951: E/AndroidRuntime(12002): at android.app.Activity.performCreate(Activity.java:4543)
12-26 17:56:31.951: E/AndroidRuntime(12002): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1071)
12-26 17:56:31.951: E/AndroidRuntime(12002): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199)
12-26 17:56:31.951: E/AndroidRuntime(12002): ... 11 more
12-26 17:56:33.251: D/Process(12002): killProcess, pid=12002
12-26 17:56:33.251: D/Process(12002): dalvik.system.VMStack.getThreadStackTrace(Native Method)
12-26 17:56:33.251: D/Process(12002): java.lang.Thread.getStackTrace(Thread.java:599)
12-26 17:56:33.251: D/Process(12002): android.os.Process.killProcess(Process.java:813)
12-26 17:56:33.251: D/Process(12002): com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:104)
12-26 17:56:33.251: D/Process(12002): java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
12-26 17:56:33.251: D/Process(12002): java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)

最佳答案

这里

Your content must have a ListView whose id attribute is 'android.R.id.list' 12-26 17:51:04.151: E/AndroidRuntime(9109): at

意味着您必须将 ListView id 设置为在 xml 布局中列出:

<ListView android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>

关于java - LogCat条目含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14043677/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com