I want to manipulate the status bar (ex.color) but in the background. I am using a foreground service to do this. Thus there is no window as it is happening in the background, specifically there is no activity. However, the function
public abstract void setStatusBarColor (int color)
is called by the abstract class Window: https://developer.android.com/reference/android/view/Window.html
And so because it is abstract I cannot initiate it and I cant use getWindow() as I do not implement an activity class. The following answer uses Activity. Is there another way to implement this? How to change the status bar color in android