Service Com.google.android.youtube.api.service.youtubeservice Has Leaked Intentreceiver Uds@5fa5135
Solution 1:
Well after trying multiple ways to use Youtube player fragment in project where we show list of videos in recycler view and each can be played in place (off course one at a time ).
Managing proper life cycle only ( calling release when removing fragment from one place to other ) will work only until you do it rapidly and if you happen to try to play 2 videos simultaneously the above issue will occur (ie internally youtube sdk will leak some touch event in message queue)
so instead of replacing youtube fragments for each video we create only one instance of fragment and reuse it at all places in app and if activity life cycle event (on pause/stop or on saved instance state is called) then we release the fragment and on resume we again create that single active instance of youtube fragment
this approach has practically fixed above issue as well https://issuetracker.google.com/issues/78370483
Post a Comment for "Service Com.google.android.youtube.api.service.youtubeservice Has Leaked Intentreceiver Uds@5fa5135"