Android 昼夜模式切换

mUiModeManager = (UiModeManager) mContext.getSystemService(Context.UI_MODE_SERVICE); if (mUiModeManager.getNightMode() == UiModeManager.MODE_NIGHT_YES) { mUiModeManager.setNightMode(UiModeManager.MODE_NIGHT_NO); } else { mUiModeManager.setNightMode(UiModeManager.MODE_NIGHT_YES); }

    推荐阅读