Possible Duplicate:
Run code when Android app is closed/sent to background
In my android app I need to be notified when users switching from my app to any other app, in order to do some security jobs. It can be by tapping on Back, Home button, through Recent Apps button. Any other ways? Couldn't find anything in android.app.Application. I have many activities in the app, to put code in Activity.onPause() won't work because it may goes to another activity in the same app. I need to find a way to be noticed. Any good idea on this? Thanks