以编程方式在Android中设置模式锁定

时间:2014-03-28 06:30:32

标签: android locking

我可以使用下面的代码以编程方式设置密码锁,但是如何以编程方式设置模式锁?

mDevicePolicyManager.setPasswordQuality(mComponentName,DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
mDevicePolicyManager.setPasswordMinimumLength(mComponentName, 5);
boolean result = mDevicePolicyManager.resetPassword("a123456",  DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);

任何帮助将不胜感激:)提前感谢:)

1 个答案:

答案 0 :(得分:-1)

这是您的首选标志:

private static final int REQ_CREATE_PATTERN = 1;

Intent intent = new Intent(LockPatternActivity.ACTION_CREATE_PATTERN,
                           null, your-context, LockPatternActivity.class);
startActivityForResult(intent, REQ_CREATE_PATTERN);

See more