下記のサンプルコードで画面を回転させた時のLogCatを確認したところ、API Level 13 から追加になったscreenSize を android:configChanges に指定してあげないといけないことがわかりました。
画面を回転させたときのLogCatは下記の通りでした。
※0x00000400:screenSize / 0x00000080:orientation となります。
ビットマスクの定義は下記で確認してください。
http://developer.android.com/reference/android/R.attr.html#configChanges
01-18 22:44:06.305: I/ActivityManager(193): Config changed: {1.0 440mcc20mnc en_US layoutdir=0 sw360dp w598dp h360dp nrml land finger -keyb/v/h -nav/h s.54} 01-18 22:44:06.336: I/SampleApp(11060): Configurations : [1152] / 0x00000400 / 0x00000080
ちなみにAndroidManifest.xmlは下記のようにしていました。
Android2.x系のまま手を加えていなかったため、Activityが再起動したのですね...
<activity android:name="WebViewActivity" android:configChanges="keyboard|keyboardHidden|navigation|orientation" />そこでscreenSizeをconfigChangesに追加してあげると、画面を縦横に切り替えてもActivityが再起動することなく無事動作するようになりました。
<activity android:name="WebViewActivity" android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenSize" />
これで一安心です。
■参考
http://developer.android.com/reference/android/content/pm/ActivityInfo.html#CONFIG_SCREEN_SIZE
Work continues on the upcoming Caesars Virginia on line casino in Schoolfield on Oct. 4. The firm now plans to open quick lived|a brief} on line casino at the site by mid-2023. Caesars Entertainment executives mentioned the plans three times during a third-quarter earnings call with traders Tuesday. During the emergency South Korean meeting, officers also lamented that the North Korean missile launches got here as South Korea is in a mourning period over the crowd crush. They noted this “clearly confirmed the character of the North Korean government,” in 로스트아크 accordance with South Korea’s presidential office.
返信削除