2013-06-19 53 views
2

時,活動泄漏了IntentReceiver我只有活動,沒有任何接收者的服務。 當我完成活動我看到在logcat中:當我沒有在清單中註冊任何回覆

E/ActivityThread: Activity com.example.some.activity has leaked IntentReceiver [email protected] that was originally registered here. Are you missing a call to unregisterReceiver()? 
android.app.IntentReceiverLeaked: Activity com.example.some.activity has leaked IntentReceiver [email protected] that was originally registered here. Are you missing a call to unregisterReceiver()? 
at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:792) 
at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:593) 
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1127) 
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1114) 
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1108) 
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:365) 
at com.android.internal.policy.impl.PhoneWindow.registerBroad(PhoneWindow.java:215) 
at com.android.internal.policy.impl.PhoneWindow.<init>(PhoneWindow.java:243) 
at com.android.internal.policy.impl.Policy.makeNewWindow(Policy.java:63) 
at com.android.internal.policy.PolicyManager.makeNewWindow(PolicyManager.java:59) 
at android.app.Activity.attach(Activity.java:4981) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2008) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 
at android.app.ActivityThread.access$600(ActivityThread.java:130) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:137) 
at android.app.ActivityThread.main(ActivityThread.java:4745) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:511) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
at dalvik.system.NativeStart.main(Native Method) 

爲我悲傷,我還沒有註冊任何接收器,所以我不知道未註冊

+0

發佈您的'com.example.some.activity'代碼。 –

回答

-2

您需要註銷上一站,接收器是什麼您的活動:

@Override 
protected void onStop() 
{ 
    unregisterReceiver(yourReceiver); 
    super.onStop(); 
} 

希望這能解決您的問題。

+0

因爲我傷心,我還沒有註冊任何Resiver – Safareli