Implement a program, mainly do not want to oncreate the phone in the same time screen, so in the configuration file added configuration options:
- Android:configchanges="Orientation|keyboardhidden"
But trace found that in the screen when the rotation will continue to call OnCreate, have you encountered such a problem?
From the SDK 3.2+, when the phone screen is found to rotate and a new screensize is added, this value will change as well. So if you don't want to redraw the interface, you need to add the screensize to the configuration file as well.
- Android:configchanges="Orientation|keyboardhidden|screensize"
Android developer is described below:
Caution:beginning with Android 3.2 (API level), the ' screen size ' also changes when the device switches between Portra It and landscape orientation. Thus, if want to prevent runtime restarts due to orientation change when developing for API level or higher (as Dec Lared by the minsdkversion and Targetsdkversion attributes), you must include the ' screensize ' value in addition to the ' O ' Rientation "value.
When Android spins a phone, how do I ignore oncreate again being called by the system?