0

I'm developing app for Zebra device model MC33.
I like how internal apps ask to enter admin pattern (password) when I open Settings or others. In my app I have settings activity and I would like to ask user for authorization.
What I want to have is: https://i.stack.imgur.com/ZuO0i.jpg

I used class DevicePolicyManager and then call for lock screen. (code is below)
But it turn off the sceen completely (it become black) like the device is switch off. Then I can enter pattern to turn it on.
This is screenshot what I get after using DevicePolicyManager: https://i.stack.imgur.com/NVGrw.jpg

DevicePolicyManager policy = (DevicePolicyManager)             
 getSystemService(Context.DEVICE_POLICY_SERVICE);
policy.lockNow();

Such behaviour may be misleading. Do you have idea how to call for proper screen in my app?

Delphi Coder
  • 1,723
  • 1
  • 14
  • 25
Asya Troyan
  • 3
  • 1
  • 5
  • This appears to be a duplicate of https://stackoverflow.com/questions/52504272/how-to-prompt-user-to-enter-pin-in-android-lock-screen – Darryn Campbell Oct 03 '19 at 23:34
  • Thanks @DarrynCampbell, using KeyguardManager helps me and it works as I expected. But as a result I get screen a little bit different because it is **black** and slightly different: https://imgur.com/gallery/orHgIkf/ – Asya Troyan Oct 07 '19 at 11:20
  • Plus when I run my app the very first time I see screen: https://imgur.com/gallery/BwpAAPI then I see my new "black" lock screen https://imgur.com/gallery/orHgIkf/. So user have to enter admin pattern twice. In the second run all works fine and only "black" lock screen appear. – Asya Troyan Oct 07 '19 at 11:29

0 Answers0