我想让我的应用程序在屏幕关闭之前自动运行(应用程序在屏幕仍然关闭时运行),这可能吗?我尝试了这段代码,但没有奏效:
KeyguardManager mKeyGuardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE);
KeyguardLock mLock = mKeyGuardManager.newKeyguardLock("AndroidSQLite");
mLock.disableKeyguard();
在 AndroidManifest 我放:
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>