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:
Post a Comment