スマホ関連の海外ニュースです。
毎回アプリケーション フォーカス (か、メニュー ボタンを押すことで手動でかアイドルに行くことによって) APP_CMD_SAVE_STATE コマンドが送信されます。 ネイティブ アクティビティ (https://developer.android.com/reference/android/app/NativeActivity.html) の Android の API ドキュメントの例ではこの特定のコマンドが送信される彼らを保存「状態」のいくつかの並べ替え中にします。 場合は、コードに見ては、値が保持構造体だけです。最初以外の値すべてになる壊れている、我々 はフォーカスを失う私たちのアプリ毎回か (はい怖い)! のような何かのための事項ごとの単一の値を保存する必要があると思った 上記のコード スニペットを削除することで簡単なテストを実行、何も変更されて、幸いなことに私の構造体の値は、それらを保存せずもフォーカスを回復した後同じをとどまった。
続きを読む…
What is the purpose of the command APP_CMD_SAVE_STATE
Everytime the application loses focus (whether manually by hitting the menu button, or by going to idle ) an APP_CMD_SAVE_STATE command is sent. In the example shown from the Android API documentation for native activity (https://developer.android.com/reference/android/app/NativeActivity.html) , when this particular command is sent they are saving some sort of “state” inside their . If you look in their code, is just a struct holding values.
Read more…