Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine the app state on pressing home button twice with app running

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.

like image 900
Runcy Oommen Avatar asked Sep 11 '12 11:09

Runcy Oommen


People also ask

How do I run an Android app on my mobile device?

I assume you have connected your actual Android Mobile device with your computer. To run the app from the android studio, open one of your project's activity files and click Run icon from the toolbar. Select your mobile device as an option and then check your mobile device which will display your default screen –

How to detect if a button has been clicked in PowerApps?

Currently, within PowerApps, the Pressed property of the Button control could not be used to detect if a button has been clicked. As an alternative solution, I think the global variable could achieve your needs.

How to run an application in Android Studio?

Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml. In the above code, we have taken a text view. Step 3 − Add the following code to src/MainActivity.java Let's try to run your application.


Video Answer


1 Answers

  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.

like image 149
martijndeh Avatar answered Sep 28 '22 00:09

martijndeh