Determine the app state on pressing home button twice with app running
Asked Answered
W

1

6

I would like to know as to what the application state would be on hitting the iphone "Home" button twice with the application running. The scenario is something like below:

  1. My iOS app is running on the foreground

  2. With the application running hit the home button twice to bring up the multi-tasking taskbar (obviously my app is not listed here because it's not a recently used app and is still running in the foreground)

  3. Now press anywhere outside the taskbar (i.e in the application) and app will be back in focus again

My questions:

  1. What state would be app be on performing above step #2? Would it enter background or still in foreground? What method would get triggered here?

  2. On performing step #3, would the app re-enter foreground from background? Again what method would get triggered here?

Any hints/suggestions would be very helpful.

Wack answered 11/9, 2012 at 11:4 Comment(0)
M
4
  1. The application is about to move from active to inactive state, so it's still in-between. You should be able to use -applicationWillResignActive: in your UIApplicationDelegate.

  2. After returning to the application, the application becomes active again thus receives a -applicationDidBecomeActive: on your UIApplicationDelegate.

Margotmargrave answered 11/9, 2012 at 11:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.