Solution 1 :
Check out the documentation for Biometric Authentication, the examples there should be get you on the right track:
https://developer.android.com/training/sign-in/biometric-auth
Solution 2 :
@user3673952 ‘s answer is for biometric access. For verifying on-device credentials, I found this helpful.
Problem :
I want to achieve something like when the user tries to open a certain activity, I want to show them a system lock screen, where they can enter their device passcode and then open a new activity.
How can I do this?