-2

In iOS if user press home button, app will move to suspended state. Double click of the home button, suspended apps appear, and selecting an app will bring back it to active state.

  • How is it by Android? App can become to suspended state pressing center button? Or app move to not running state?
  • If suspended state exist, how to bring back to running state, where I can select one app among many?
  • In an activity the oncreate method will get called only once, when app first starts? Which method is get called that will called always when app appears, come back to running state?
János
  • 32,867
  • 38
  • 193
  • 353
  • Search with keywords "android activity lifecycle guide". https://developer.android.com/reference/android/app/Activity.html – Toris Oct 02 '16 at 13:06

1 Answers1

0

Have a look over Android Activity Lifecycle

In android, if the app is not "on the main screen" it counts as Paused state.

By starting an app, there will be a one and only call for onCreate, later will be called onStart and onResume. If you will now click the home button, the onPause and onStop method will be called. Once you wish to back to the activity you can press the Overview button, and select your app from the list and the method onRestart, onStart and onResume will then be called.

If your app is not fully hidden, e.g you swing your finger from top to bottom to see "notification center", this will cause skipping the onStart, onStop and onRestart functions.

Erik
  • 221
  • 1
  • 7
  • Aaaa, I almost have my first Android app, but I never noticed pressing long the "overview", home button will show list of suspended apps. :D – János Oct 02 '16 at 13:11
  • It does not, it does state the last accessed apps, the app that are shown there might or might not be alive at all – Erik Oct 02 '16 at 13:14
  • I just realized an other thing: if an app is not listed when pressing Overview button, it does not mean it is `not running`, because in Setting app's `Force stop` button is enabled. – János Oct 02 '16 at 13:20