I want to manage the status bar (ex.color), but in the background. I use the foreground service for this. Thus, there is no window, as this happens in the background, in particular, there is no activity. However function
public abstract void setStatusBarColor (int color)
called by the abstract Window class: https://developer.android.com/reference/android/view/Window.html
And because it is abstract, I cannot initiate it, and I cannot use getWindow (), since I do not implement an activity class. The following answer uses Activity. Is there any other way to implement this? How to change status bar color in android
android statusbar android-windowmanager android-statusbar
Sarah cartenz
source share