I want to Implement Screen lock in my app like, how Most of the payment gateway based apps do, I have tried using KeyGuardManager , which work after Lollipop only, the problem is my app also supports KitKat, that's why I need help
This is what I have Tried
KeyguardManager km = (KeyguardManager)getSystemService(KEYGUARD_SERVICE);
if(km.isKeyguardSecure()) {
Intent i = km.createConfirmDeviceCredentialIntent("Authentication required", "password");
startActivityForResult(i, CODE_AUTHENTICATION_VERIFICATION);
}
else
Toast.makeText(this, "No any security setup done by user(pattern or password or pin or fingerprint", Toast.LENGTH_SHORT).show();