Here you can find the source of setScreenBrightness(final Activity pActivity, final float pScreenBrightness)
Parameter | Description |
---|---|
pActivity | a parameter |
pScreenBrightness | [0..1] |
public static void setScreenBrightness(final Activity pActivity, final float pScreenBrightness)
//package com.java2s; import android.app.Activity; import android.view.Window; import android.view.WindowManager; public class Main { /**//w w w. j a va 2 s . c o m * @param pActivity * @param pScreenBrightness [0..1] */ public static void setScreenBrightness(final Activity pActivity, final float pScreenBrightness) { final Window window = pActivity.getWindow(); final WindowManager.LayoutParams windowLayoutParams = window .getAttributes(); windowLayoutParams.screenBrightness = pScreenBrightness; window.setAttributes(windowLayoutParams); } }