Android中ActivityThread例外? [英] ActivityThread exception in Android?
问题描述
我的工作任务要搜索的存储在数据库的位置。从那以后,我必须在相应位置放置图钉。我做了对快速搜索框(QSB)修改搜索DB这是在我的应用程序。对于QSB表现我跟着API演示搜索字典的例子。当我点击它重新加载当前活动的搜索建议并删除针就可以了。单击后退按钮时,它显示在logcat中下面的例外。为什么会发生。任何想法?
I am working on the task to search a location which stored in DB. After that i have to drop a pin on the corresponding location. I made a modification on Quick Search Box(QSB) to search the DB which is in my app. for that QSB performance i followed the Search Dictionary example in API Demos. when i click the search suggestion it reloads the current activity and drop the pin on it. when click the back button it shows the below exception in the Logcat. why it happens. Any Idea?
我的日志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的活动主题异常?请帮助。
What is the Activity Thread Exception in Android? Please Help.
推荐答案
我得到了同样的问题,搜索后,我发现这个职位对同样的问题。
I got the same problem and after searching I found this post about the same issue
的https://novoda.lighthouseapp.com/projects/63622/tickets/157-leak-receiver-searchresult
这表明问题使用应用程序的多个地图活动
时上升。
it suggests that the problem rises when using multiple map activities
within your application.
所以在的manifest.xml 我的应用我做每个地图活动的文件在一个单独的进程中运行:
so in manifest.xml file of my app I made each map activity run in a separate process:
android:process=":p1"
android:process=":p2"
您可以在Android电子文档阅读更多关于这一点。 http://developer.android.com/guide/topics/manifest /activity-element.html#proc
you can read more about this in Android docs. http://developer.android.com/guide/topics/manifest/activity-element.html#proc
这篇关于Android中ActivityThread例外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!