本文介绍了禁用锁定屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一种方式来取代股票锁屏(带有一个应用程序,而不是ROM)。什么是做到这一点,一开始取消对尽可能多的设备尽可能的锁屏的最佳方法是什么?谢谢!

解决方案

  KeyguardManager keyguardManager =(KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock锁= keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();
 

在androidmanifest:

 <使用-权限的Andr​​oid:名称=android.permission.DISABLE_KEYGUARD/>
 

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 possible?Thanks!

解决方案
KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();

in androidmanifest:

<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>

这篇关于禁用锁定屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 16:16