0

This is the code which I use for changing color of status bar icon:

window.decorView.systemUiVisibility = if (light) {
    View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
} else {
    View.SYSTEM_UI_FLAG_VISIBLE
}

Unfortunately it does not work for Window object of a Dialog. Any idea why?

EDIT: It is not a duplicate of Android statusbar icons color - the link SO thread doesn't mention Dialogs

Mariusz
  • 1,825
  • 5
  • 22
  • 36

2 Answers2

0

The problem was that I was executing this code from DialogFragment.onStart and I should call it from onResume

Mariusz
  • 1,825
  • 5
  • 22
  • 36
-1

Activity and child dialog of that activity share's same window. So if you set something on window inside dialog code it will still impact the window of that activity. If you are dealing with dialog title then its not status bar. Its title view of that dialog

Vishal Pawar
  • 4,324
  • 4
  • 28
  • 54