// 是否屏蔽状态栏,false表示隐藏状态栏
public static void shieldStatusBar(Context context, boolean enable) {
StatusBarManager mStatusBar = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE);
int state = StatusBarManager.DISABLE_NONE;
if (!enable) {
state |= StatusBarManager.DISABLE_EXPAND;
}
mStatusBar.disable(state);
}
public static void shieldStatusBar(Context context, boolean enable) {
StatusBarManager mStatusBar = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE);
int state = StatusBarManager.DISABLE_NONE;
if (!enable) {
state |= StatusBarManager.DISABLE_EXPAND;
}
mStatusBar.disable(state);
}