gpt4 book ai didi

android - Android 中的 ActivityThread 异常?

转载 作者:太空狗 更新时间:2023-10-29 16:25:23 30 4
gpt4 key购买 nike

我正在执行搜索存储在数据库中的位置的任务。之后我必须在相应的位置放置一个图钉。我对快速搜索框 (QSB) 进行了修改,以搜索我的应用程序中的数据库。对于 QSB 性能,我遵循了 API 演示中的搜索字典示例。当我单击搜索建议时,它会重新加载当前 Activity 并将图钉放在上面。单击后退按钮时,它会在 Logcat 中显示以下异常。为什么会发生。任何想法?

我的日志 CAT 值:

05-17 15:16:30.572: ERROR/ActivityThread(17448): Activity com.example.brown.Bru_Maps has leaked IntentReceiver    android.net.NetworkConnectivityListener$ConnectivityBroadcastReceiver@432e6360 that was originally registered here. Are you missing a call to unregisterReceiver()?
05-17 15:16:30.572: ERROR/ActivityThread(17448): android.app.IntentReceiverLeaked: Activity com.example.brown.Bru_Maps has leaked IntentReceiver android.net.NetworkConnectivityListener$ConnectivityBroadcastReceiver@432e6360 that was originally registered here. Are you missing a call to unregisterReceiver()?
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ActivityThread$PackageInfo$ReceiverDispatcher.<init>(ActivityThread.java:748)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ActivityThread$PackageInfo.getReceiverDispatcher(ActivityThread.java:576)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ApplicationContext.registerReceiverInternal(ApplicationContext.java:770)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ApplicationContext.registerReceiver(ApplicationContext.java:757)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ApplicationContext.registerReceiver(ApplicationContext.java:751)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:290)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.net.NetworkConnectivityListener.startListening(NetworkConnectivityListener.java:138)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at com.google.android.maps.MapActivity.onResume(MapActivity.java:232)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1225)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.Activity.performResume(Activity.java:3559)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2838)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2866)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1819)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.os.Handler.dispatchMessage(Handler.java:99)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.os.Looper.loop(Looper.java:123)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at android.app.ActivityThread.main(ActivityThread.java:4203)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at java.lang.reflect.Method.invokeNative(Native Method)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at java.lang.reflect.Method.invoke(Method.java:521)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
05-17 15:16:30.572: ERROR/ActivityThread(17448): at dalvik.system.NativeStart.main(Native Method)

什么是Android中的Activity Thread Exception?请帮忙。

最佳答案

我遇到了同样的问题,搜索后我发现了这篇关于同样问题的帖子

https://novoda.lighthouseapp.com/projects/63622/tickets/157-leak-receiver-searchresult

这表明在您的应用程序中使用多个 map activity 时会出现问题。

所以在我的应用程序的 ma​​nifest.xml 文件中,我让每个 map Activity 在一个单独的进程中运行:

android:process=":p1"
android:process=":p2"

您可以在 Android 文档中阅读更多相关信息。 http://developer.android.com/guide/topics/manifest/activity-element.html#proc

关于android - Android 中的 ActivityThread 异常?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2848106/

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