I have a tab UI, with a Fragment Tab host at bottom and fragments in a container fragment. Every time I change Tab I switch between fragments within the container fragment.
Now the issue is as below: I have a fragment with a video view streaming live video. while the video is buffering if I press back key the fragment takes too long to stop. I can see a big lag of 2-3 seconds from the time onStop() of this fragment till oCreateView() of other fragment. All my other methods like onDestroy, onDestroyVeiw() etc are empty.
I have come to a conclusion that it is because the video view is busy with initialization/buffering it take android time to stop all these activities synchronously in video view and then stops the fragment.
What I am looking for is to stop the video buffering Asynchronously.. so that my UI for next fragment is not shown with the lag.
regards,
ticks_sunny
来源:https://stackoverflow.com/questions/36340085/nested-fragment-with-videoview-streaming-takes-too-long-while-stopping