Android onAppHasFocus onAppLosesFocus
Thanks in adv开发者_Python百科ance for your help with this question
I want to know when my app gains and loses focus.
I know how to tell when a specific activity window gains or loses focus, but if the main activity window has sub windows that open, the main window loses focus
I want to know when my app loses focus entirely, including it's sub activities, and gains focus after it was entirely out of focus
thanks
Check
onPause
and
onResume
- Extend the Application
- Create for each activity a boolean inside
- onPause() / onDestroy() of each activity sets its boolean to false and calls the Application's checkIfAllDead()
checkIfAllDead() checks if all the booleans are false...
精彩评论