Reputation: 188
Ho do I set Android system settings to dim after a set period of time.
android.provider.Settings.System.putInt(getContentResolver(),
Settings.System.DIM_SCREEN, time);
but Settings.System.DIM_SCREEN is deprecated.I also tried Power Manager PowerManager.SCREEN_DIM_WAKE_LOCK which is also deprecated Any other way around for the same.
Upvotes: 3
Views: 3644
Reputation: 4357
WindowManager.LayoutParams WMLP = getWindow().getAttributes();
WMLP.screenBrightness = 0.15F;
getWindow().setAttributes(WMLP);
Upvotes: 2