Friday 15 June 2012

Awake Screen(Screen On) when starting activity




First import this file
import android.view.WindowManager.LayoutParams;


call this method whenever you need to On the screen
 private void unlockScreen() {
        Window window = this.getWindow();
        window.addFlags(LayoutParams.FLAG_DISMISS_KEYGUARD);
        window.addFlags(LayoutParams.FLAG_SHOW_WHEN_LOCKED);
        window.addFlags(LayoutParams.FLAG_TURN_SCREEN_ON);
    }

No comments: