Search code examples
androidfocuslockscreen

Know when app gains focus after lockscreen is passed


What would be the easiest way to know when my app gets focus after the pattern lock is passed? onResume is called as soon as my screen is turned back on, regardless of the patten lock activity being in front of it (assuming my app was the last thing open before turning off the screen).


Solution

  • I think your best bet is Activity.onWindowFocusChanged()