mobile: use onConfigurationChanged instead of restoring savedInstanceState
This commit is contained in:
parent
f45ee1162a
commit
529f7fa254
@ -17,6 +17,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
import android.content.res.Configuration;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@ -51,12 +52,6 @@ public class IITC_Mobile extends Activity {
|
||||
};
|
||||
sharedPref.registerOnSharedPreferenceChangeListener(listener);
|
||||
|
||||
// we do not want to reload our page every time we switch orientations...
|
||||
// so restore state if activity was already created
|
||||
if(savedInstanceState != null) {
|
||||
iitc_view.restoreState(savedInstanceState);
|
||||
}
|
||||
else {
|
||||
// load new iitc web view with ingress intel page
|
||||
Intent intent = getIntent();
|
||||
String action = intent.getAction();
|
||||
@ -76,7 +71,6 @@ public class IITC_Mobile extends Activity {
|
||||
iitc_view.loadUrl(addUrlParam("https://www.ingress.com/intel"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
@ -104,10 +98,10 @@ public class IITC_Mobile extends Activity {
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
// save instance state to avoid reloading on orientation change
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
iitc_view.saveState(outState);
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
Log.d("iitcm", "configuration changed...restoring...");
|
||||
super.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
// we want a self defined behavior for the back button
|
||||
|
Loading…
x
Reference in New Issue
Block a user