
[英]devicePolicyManager.lockNow() is not working for Motorola Tablets
[英]what is the difference between keyguardlock.reenableKeyguard() and DevicePolicyManager.locknow()?
我想知道两者之间有什么区别
KeyguardManager localKeyguardManager = (KeyguardManager)getSystemService("keyguard");
String str1 = getClass().toString();
keyguardlock = localKeyguardManager.newKeyguardLock(str1);
keyguardlock.reenableKeyguard();
和
mDPM = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
mAM = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
mDeviceAdminSample = new ComponentName(Controller.this, UnLockAdminReceiver.class);
setContentView(R.layout.main);
Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN); intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mDeviceAdminSample);
intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION, "Additional text explaining why this needs to be added.");
startActivity(intent);
mDPM.lockNow();
*使用DevicePolicyManager锁定android有什么好处,我还需要知道我们是否可以使用DevicePolicyManager来解锁手机*
keyguardLock方法锁定屏幕,而DevicePolicyManager locks方法锁定设备
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.