I'm using an Activity that has a layout with android.support.v4.view.ViewPager that I used to manipulate Tab navigation. I have different Fragments for different Tabs. On my third Tab, I'm loading some YouTube thumbnails from my YouTube account.
When I load the application (when I'm staying at the first Tab) and press Back to exit from the application, it exists without any issue. But when I navigate to second Tab and try to press Back button, app exists with an error as follow.
E/ActivityThread(7187): Activity package.name.ActivityName has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@41e5d180 that was originally bound here
E/ActivityThread(7187): android.app.ServiceConnectionLeaked: Activity package.name.ActivityName has leaked ServiceConnection com.google.android.youtube.player.internal.r$e@41e5d180 that was originally bound here
I've added YouTube Data API v3 to my project.
How can I solve this issue? Why the error appears when exiting from second Tab but not in First Tab?
This is not a duplicate question of this.