LoginSignup
5
3

More than 5 years have passed since last update.

Androidの端末回転時のライフサイクルを確認

Last updated at Posted at 2018-02-27

Android開発をしていて、端末回転時のライフサイクルの確認をしたくなる時がちょこちょこあったので備忘録を残す。

-----------------Activity起動-----------------
D/debug: onCreate()
D/debug: setUp()
D/debug: onStart()
D/debug: onResume()
-------------------端末回転-------------------
D/debug: onSaveInstanceState()
D/debug: onDestroy()
D/debug: onCreate()
D/debug: onStart()
D/debug: onRestoreInstanceState()
D/debug: onResume()

ついでに基本的なActivity(とFragment)のライフサイクルも記載する。

Activityのライフサイクル

https://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle
Activity-life-cycle.png

Fragmentのライフサイクル

https://developer.android.com/guide/components/fragments.html#Creating
Fragment-life-cycle.png

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3