Error: YouTubeService has leaked IntentReceiver … Are you missing a call to unregisterReceiver()?

 ̄綄美尐妖づ 提交于 2019-12-01 03:32:43
rod

Even if you do not manually register any receiver, an activity may register it to use it in some way on the current activity. I think you should need to call unregisterReceiver() method on onPause().

Please be aware that onDestroy() and onStop() are not guaranteed to be called. If onPause() will be called, then the Activity is no longer in the foreground.

OnStop():

Called when you are no longer visible to the user. You will next receive either onRestart(), onDestroy(), or nothing, depending on later user activity. Note that this method may never be called, in low memory situations where the system does not have enough memory to keep your activity's process running after its onPause() method is called.

For more information, here's the link: http://developer.android.com/reference/android/app/Activity.html#onStop%28%29

Fortunately, I also found some stackoverflow items that you can refer to:

I hope this will help.

Hugo Alberto

I solved this:

In manifest.xml Declare something like this.

<activity
    android:name=".YouTubeActivity"
    android:configChanges="keyboardHidden|orientation|screenSize"
    android:screenOrientation="landscape"
    android:theme="@style/AppTheme.NoActionBar" />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!