Android nougat status bar shows white color when launching an activity
Asked Answered
F

1

7

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 .

Fluctuate answered 30/11, 2016 at 10:32 Comment(3)
did u find any solution?Soerabaja
@AmrutBidri no . I still have not found any solution.Fluctuate
I'm having the same problem. I don't suppose you've had any luck since?!Raffinose
R
1

Add <item name="android:windowIsTranslucent">true</item> In your activity theme value-v21/syles.xml.
Because android:windowIsTranslucent will make My phone(Api=19) status bar show white for a moment.And cause the activity translate animator not work.
So your can create value-v21 and add the code in styles.xml.

Rhombic answered 23/12, 2016 at 5:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.