The attribute
android:configChanges="orientation|screenSize"
activity
element
prevents the activity from being destroyed and recreated.
Warning: this means that the
res/values/strings.xml
res/values-land/strings.xml
onConfigurationChanged
method of the activity is called
and you’ll have to make all the adjustments yourself.
See
Handling
the Configuration Change Yourself.
EtchActivity.java
EtchView.java
main.xml
:
unused.AndroidManifest.xml
:
added the attribute
android:configChanges="orientation|screenSize"
activity
element.
The output lists the fields of the
Configuration
object.
The app was launched in portrait orientation.
The first line of output was generated when we switched to landscape,
the second line when we switched back to portrait.
adb logcat myTag:D '*:S'
D/myTag ( 1287): {1.0 310mcc260mnc en_US layoutdir=0 sw320dp w533dp h320dp nrml long land finger qwerty/v/v tball/v s.27} D/myTag ( 1287): {1.0 310mcc260mnc en_US layoutdir=0 sw320dp w320dp h533dp nrml long port finger qwerty/v/v tball/v s.28}