Hello, dear forum users. I use fragments and tabs. Fragments are switched using the viewPager and a fragment adapter for it. There was a problem with the fragment on which the camera is implemented: I have 5 fragments, a fragment with a camera in the middle (3), so if I switch to the second or fourth after it, then the surface view remains visible on them! (Without a camera, just a black place) But if I switch to the first and the last, then everything is perfectly hidden. Traced the lifecycle, when the first and the last one is called, he StopPaus, etc. with a camera with a ragenta, but with neighboring fragments not available. It is not difficult to understand that this is done for quick switching between the nearest fragments.
So how do I remove it? So that when switching neighbors too, onStop and it Pauses were also called
I tried to call them manually, it does not help ... I also read about the addToBactStack () method, which seems to help. But I have to call it when switching, and the adapter is doing this inside
Help please, thank you very much!