views:

480

answers:

1

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?

My Log CAT Value:

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)

What is the Activity Thread Exception in Android? Please Help.

+1  A: 

Hi..

You have your answer in the exception log..

Are you missing a call to unregisterReceiver()?

Did you register a broadcast receiver in your application?If yes you should call unregister receiver before destroy your activity.

EDIT

Hi..

i had a look at ConnectivityBroadcastReceiver and i found this discussions..

on Android Developers

on android google code

they have the same problem..could you post your code?

hara
i didnt register any broadcast Receiver file. i just using getIntent(). is that a problem?
Praveen Chandrasekaran
I can confirm the same issue (I'm on 2.2). I also didn't register any receiver.
Mathias Lin