0

我有一个使用 ProgressDialog 的活动。

执行后dialog.dismiss(),屏幕一直是灰色的,直到用户按下屏幕才会亮起。

命令后如何使屏幕亮起dialog.dismiss()

4

1 回答 1

0
int brightnessMode = Settings.System.getInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE);
if (brightnessMode == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
    Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
}

WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
layoutParams.screenBrightness = 0.5F; // set 50% brightness
getWindow().setAttributes(layoutParams);
于 2012-08-22T08:58:42.433 回答