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).
Asked
Active
Viewed 589 times
2 Answers
1
You can check if your Activity or View has focus by calling:
Activity.hasWindowFocus()
or
View.hasFocus()
http://developer.android.com/reference/android/app/Activity.html#hasWindowFocus() http://developer.android.com/reference/android/view/View.html#hasFocus()

raingod
- 1,377
- 1
- 11
- 24