keep Screen On - Android User Interface

Android examples for User Interface:Screen Dormant

Description

keep Screen On

Demo Code


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

import android.view.WindowManager;

public class Main {
    public static void keepScreenOn(final Activity mActivity) {
        mActivity.getWindow().addFlags(//from  w w w  .  j  a v  a2s  .co  m
                WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    }
}

Related Tutorials