Skip to main content

ScreenLight.java (Source)

package com.errormessaging.screenlight;
import android.app.Activity;
import android.os.Bundle;
import android.view.WindowManager;
public class ScreenLight extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        WindowManager.LayoutParams lp = getWindow().getAttributes();
        lp.screenBrightness = 1f;
        lp.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
        getWindow().setAttributes(lp);
        
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}