Disable Lock Screen

前端 未结 4 1026
耶瑟儿~
耶瑟儿~ 2020-12-02 17:31

I am looking for a way to replace the stock lock screen (with an app, not a rom). What is the best way to do it, for a start to disable the lock screen on as much devices as

4条回答
  •  心在旅途
    2020-12-02 17:53

    Try this, it will keep awake the screen/ display , as long as the activity is on top.

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

    Also this does not require any permission in manifest.

提交回复
热议问题