Upon launching my application, a few web service calls are made to check for new data on our server. When I launch the applciation from scratch it works fine, but my app runs in the background until the user hits the back button a bunch of times, but I would still like our web service calls to be made whether he’s launching a fresh instance or resuming an instance that was kept in the background.
Is there a method that’s called when the applcition regains focus? (And only when it “regains” focus?)
Thanks a lot.
This page explains Android activity lifecycle: http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle
Activity’s onResume() will be called every time the activity is brought to foreground but that happens also when launching it for the first time. If you are looking for a method that is called only when the focus regained, try onRestart().