I have a service that should check periodically visibility of status bar, when some top activity is (or not) in fullscreen mode. Is it possible?
public boolean isStatusBarVisible() { Rect rectangle = new Rect(); Window window = getActivity().getWindow(); window.getDecorView().getWindowVisibleDisplayFrame(rectangle); int statusBarHeight = rectangle.top; return statusBarHeight != 0; }