Disable/Delay Android Lock Screen Programmatically

后端 未结 3 1598
南旧
南旧 2021-01-02 10:59

I’d like to disable/delay the lock screen programmatically. In looking into this, KeyguardManager is depreciated/doesn\'t work consistently,

3条回答
  •  忘掉有多难
    2021-01-02 11:29

    the answer of @nandeesh is working but it's deprecated , to disable lock screen use flags :

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
    

提交回复
热议问题