我想在后台中操作状态栏(例如颜色)。我使用前台服务来实现这一点。因此,由于是在后台进行操作,没有窗口,特别是没有活动。但是,该功能
public abstract void setStatusBarColor (int color)
抽象类Window调用:https://developer.android.com/reference/android/view/Window.html
由于它是抽象的,我不能初始化它,也不能像实现activity类那样使用getWindow()。 以下答案使用Activity。是否有其他方法来实现这个呢? 如何在Android中更改状态栏颜色