In my android application, I have a MainActivity say M. this activity uses Android's tabLayout widget to initialize four tabs. Each tab corresponds to one Fragment say F1,F2,F3,F4 are four fragments.
From F2 , i am launching an activity say C . But while C is being launched the status bar on my device flickers for a moment. By flickering i mean, originally its dark (black) colors . then it fades a bit to white color and again becomes dark. Now C gets launched . When i try to exit from C, back to F2 (by pressing navigation back button) again same effect is shown, But this time it gets worse . I mean the status bar remains in white color for a bit long . Then it goes back to dark color.
I am observing this issue only on android Nougat. On the previous versions its wokring .
So far i have tried How do I prevent the status bar and navigation bar from animating during an activity scene animation transition?
The above link has two approaches :
Appraoch 1. It 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 .