屏幕锁有一些很好的安全机制。(比如密码,密码,图案.)
我的AP希望有一个类似的安全机制。
是否有可能调用屏幕锁定安全机制?
(所以我的AP只需要知道结果,而不需要自己处理安全性)
发布于 2016-11-16 06:41:02
我找到了一种方法,供别人参考
//put below source code in where you want to launch password UI
km = (KeyguardManager) getSystemService(context.KEYGUARD_SERVICE);
if(km.isKeyguardSecure()) {
Intent i = km.createConfirmDeviceCredentialIntent(null, null);
activity.startActivityForResult(i, 1234);
}
// call back when password is correct
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 1234) {
if (resultCode == RESULT_OK) {
//do something you want when pass the security
}
}
}https://stackoverflow.com/questions/39202487
复制相似问题