0

I have an app, that after I finish I want the app to go to the lock screen, however I am unable to do so. How can I do this?`

//Lock screen
finish();
Angel Koh
  • 12,479
  • 7
  • 64
  • 91
Jerg
  • 95
  • 1
  • 6
  • you can look at this post too. https://stackoverflow.com/questions/14352648/how-to-lock-unlock-screen-programmatically – Angel Koh Sep 27 '18 at 01:36
  • Angel I looked into it and I found this: – Jerg Sep 27 '18 at 01:43
  • https://stackoverflow.com/questions/12723185/android-screen-lock-unlock-programmatically/12723269#12723269 – Jerg Sep 27 '18 at 01:43
  • However, Context is not working for me. How Do I make context work? – Jerg Sep 27 '18 at 01:44
  • if you are calling it from the Activity class, just remove Context and use getSystemService(...); if you are calling from the Fragment class, use getContext().getSystemService(...) – Angel Koh Sep 27 '18 at 01:46

0 Answers0