Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.app.Activity;

import android.view.Window;
import android.view.WindowManager;

public class Main {
    /**
     * @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);
    }
}