Find information online:
For node <activity/> Add Property " android:configchanges=" Orientation|keyboardhidden|screensize "" as follows:
1 <Activity2 Android:name=". Mainactivity "3 Android:label= "@string/app_name" 4 android:configchanges= "Orientation|keyboardhidden|screensize" >5 <Intent-filter>6 <ActionAndroid:name= "Android.intent.action.MAIN" />7 8 <categoryAndroid:name= "Android.intent.category.LAUNCHER" />9 </Intent-filter>Ten </Activity>
Note point: (no test)
Android2.3 Use the above "android:configchanges=" Keyboardhidden|orientation "" before it can be done. However, after 4.0. You must use this property "android:configchanges=" Orientation|keyboardhidden|screensize "" to avoid activity reloading the class does not extend the above-mentioned rebuild process!
ZC: Write directly "android:configchanges=" orientation|keyboardhidden|screensize "" no matter what version it is ...
PS: You can also override the function onconfigurationchanged, to do something in the event of the screen, but I do not need it, regardless of it ...
Reference pages:
Http://www.cnblogs.com/hibraincol/archive/2010/09/18/1829862.html
http://blog.csdn.net/junhuahouse/article/details/38109125
Web content saved in: Baidu Cloud Codeskill33--"All Files > from __ page > Android_eclipse > Let Android switch between the screen and the current activity is not destroyed"
X
Allow Android to switch between the screen and the current activity is not destroyed