在您的应用程序中使用此代码,它对我有用:
DevicePolicyManager devicePolicyManager =
(DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
ComponentName demoDeviceAdmin = new ComponentName(this, name of activity);
devicePolicyManager.setPasswordQuality(
demoDeviceAdmin,DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED);
devicePolicyManager.setPasswordMinimumLength(demoDeviceAdmin, 5);
boolean result = devicePolicyManager.resetPassword("123456",
DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);
Toast.makeText(this, "button_lock_password_device..."+result, Toast.LENGTH_LONG).show();
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)