I want my app to do a certain implementation only when the app is being resumed from the launcher. Kind of like when the user hits the Home button and resume the App back later.
This implementation should not fire when these happen, for example;
- Activity changes within the App itself.
- Phone call or any other kind of interruption that will bring the App to the background.
I know I shouldn’t be capturing the home button pressed event. Are there any alternative way to capture what the Home button does/call so that the App can recognize it?
Thanks in advance!
EDIT: onUserLeaveHint() does do somewhat the thing I want (point 2). But when going through activities, this method will be called too. Just wondering if there’s anyway (not perfect but better solution) out there that anyone can share. Thanks!
if you press the home button of your application while running onPause() will be called and your app goes to the background.when ur app comes to the foreground onResume() will be called.
Also onUserLeavehint() will be called when hit the home button.