0

I make easy app for test functions like onCreate(), onStart, etc. Each function make you own log. And start test.

  • a) When app is started - onCreate, then onStart and onResume.
  • b) When press collapse all window button - onPause and onStop.
  • c) When select app from list - onRestart, then onStart and onResume.
  • d) When press Back button - onPause, onStop and onDestroy.

Here's my questions:

  1. Why onResume method is called when I execute my app? (in a)
  2. Why onPause and onStop methods are called together? (in b)
  3. Why in C called three methods instead onRestart, or onResume? (in c)
  4. Why onDestroy method is called? (in d)

P.S.: Sorry for english :)

Gordey
  • 33
  • 5

1 Answers1

0

Here is the Android lifecycle:

enter image description here

You can see the answers to your questions by following the chart.

mamba4ever
  • 2,662
  • 4
  • 28
  • 46
David S.
  • 6,567
  • 1
  • 25
  • 45