I've got an activity indicator set up to start spinning when a file is getting downloaded from the internet. The file is downloaded asynchronously, and it also makes a request to continue downloading should the user send the app into the background or start another app. However, upon resuming my app, the activity indicator is no longer spinning, even though I haven't stopped it in code.
I set up a flag to let me know whether the activity indicator should be spinning, and I thought I could detect when the app came to the foreground, test the flag, and start the activity indicator up again, but none of the logical methods appear to fire when I set them up. I've tried the following:
- (void)applicationDidBecomeActive:(UIApplication *)application
- (void)applicationWillEnterForeground:(UIApplication *)application
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
- (void)applicationWillResignActive:(UIApplication *)application
- (void)applicationDidEnterBackground:(UIApplication *)application
As I said, none of these methods fire when when the user switches back to the app (or away from it, for that matter).
What am I doing wrong?