2

I'm experiencing a strange problem. I have an app, based on fragments. When I want to change fragments, I first check if the fragment is added. After hiding the previous fragment, if the next fragment is already added before, I just show it. If it is not added before, then I add it. And one of my fragments has a VideoView declared in it's XML file.

Now my problem is, if the fragment is not added already, when I try to add it, the whole screen goes black for a second and then comes back with the new fragment. The portion that I am placing the fragment is only a part of the screen, so it should only refresh that portion of the screen. After the fragment is added, when I try to navigate to it (when I use show() method), I do not experience this behaviour. I believe this has something to do with the VideoView, because if I remove it from XML, I no longer experience this problem. I tried adding the VideoView programmatically, but I still had the problem. I also tried to use a SurfaceView to play the video, but in that case, again I have the same problem.

I would appreciate any suggestions. Thank you.

4

0 回答 0