SeekBar - 泄漏IntentReceiver

时间:2016-02-24 21:48:17

标签: android broadcastreceiver seekbar android-seekbar android-broadcastreceiver

当我使用SeekBar时,我总是收到以下警告:

Activity com.prom.gallery.activities.VideoActivity has leaked IntentReceiver android.widget.AbsSeekBar$2@1803f19a that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Activity com.prom.gallery.activities.VideoActivity has leaked IntentReceiver android.widget.AbsSeekBar$2@1803f19a that was originally registered here. Are you missing a call to unregisterReceiver()?
    at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:968)
    at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:769)
    at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:2016)
    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1996)
    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1990)
    at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:503)
    at android.widget.AbsSeekBar.registerReceiver(AbsSeekBar.java:1603)
    at android.widget.AbsSeekBar.<init>(AbsSeekBar.java:209)
    at android.widget.SeekBar.<init>(SeekBar.java:87)
    at android.widget.SeekBar.<init>(SeekBar.java:83)
    at android.support.v7.widget.AppCompatSeekBar.<init>(AppCompatSeekBar.java:44)
    at android.support.v7.widget.AppCompatSeekBar.<init>(AppCompatSeekBar.java:40)
    at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:128)
    at android.support.v7.app.AppCompatDelegateImplV7.createView(AppCompatDelegateImplV7.java:938)
    at com.mikepenz.iconics.context.IconicsLayoutInflater.onCreateView(IconicsLayoutInflater.java:23)
    at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:732)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:366)
    at com.malmstein.fenster.controller.SimpleMediaFensterPlayerController.onFinishInflate(SimpleMediaFensterPlayerController.java:82)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:826)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:366)
    at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
    at com.prom.androknife2.baseClasses.BaseActivity.onCreate(BaseActivity.java:22)
    at com.prom.gallery.activities.BaseActivity.onCreate(BaseActivity.java:28)
    at android.app.Activity.performCreate(Activity.java:6374)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2743)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2855)
    at android.app.ActivityThread.access$900(ActivityThread.java:181)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1474)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:6117)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

我怎样才能摆脱它?似乎SeekBar使用BroadcastReceiver,但永远不会取消注册...

0 个答案:

没有答案