In my Android app, I have a MainActivity function. M. This activity uses the Android tabLayout widget to initialize four tabs. Each tab corresponds to one fragment, say, F1, F2, F3, F4 - four fragments.
From F2, I run an action, say C. But while C starts, the status bar on my device flickers for a moment. By flickering, I mean, initially its dark (black) colors. then it gradually fades to white and becomes dark again. Now C starts up. When I try to exit C, go back to F2 (by pressing the navigation button back) the same effect is displayed again, but this time it gets worse. I mean, the status bar stays a bit white. Then it returns to a dark color.
I observe this problem only on android nougat. In previous versions of his wokring.
So far I have tried How can I prevent the status bar and navigation bar from appearing during the transition of an activity scene animation?
The above link has two approaches: Appraoch 1. This did not work for me. Approach 2. My application crashes because findViewById(android.R.id.statusBarBackground);
returns null.
Please suggest how I can solve this problem.
source share