我知道如何使用DevicePolicyManager锁定设备..
boolean active = mDPM.isAdminActive(mDeviceAdminSample);
if (active) mDPM.lockNow();
但如何解除此问题(解锁手机)?
答案 0 :(得分:-1)
试试这个
KeyguardManager mKeyGuardManager = (KeyguardManager) DetSystemService(KEYGUARD_SERVICE);
KeyguardManager.KeyguardLock mLock = mKeyGuardManager.newKeyguardLock("MainActivity");
mLock.disableKeyguard();
http://developer.android.com/tools/testing/activity_testing.html#UnlockDevice
然而,我不满足于这个解决方案,因为它使用了弃用的方法...希望有人知道更多......