Android examples for User Interface:Screen Dormant
keep Screen On
//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); } }