Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
変更された画像を含む GridView の回転と再描画の場合にバンドルを保存するには、どちらがバンドルを保存するのに適していますか: OnSaveInstanceState または OnPause?
onPause()アクティビティがフォアグラウンドステータスを失うたびに呼び出され、その後フォアグラウンドになると、対応するものonResume()が呼び出されます。したがって、ここでUI関連の情報(更新など)を確認します。
onPause()
onResume()
onSaveInstanceState()バンドルを保存する場所です。バンドル(アクティビティ状態情報)の取得は、またはのいずれかで実行できonCreate()ますonRestoreInstanceState()。
onSaveInstanceState()
onCreate()
onRestoreInstanceState()