I read a lot of posts about this issue, such as [this link] [1], and one solution adds the configChanges orientation to manifest and handle the onConfigurationChanged event to prevent the onCreate operation from repeating during rotation. I did this and the event fires properly, however after that execution the onCreate method also executes! What for? What am I missing? Thanks you
manifest
<activity
android:name="webPush"
android:configChanges="keyboardHidden|orientation"/>
activity,
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
setContentView(R.layout.vistaaib);
}
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.vistaaib);
...
source
share