aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/org/traccar/manager/MainActivity.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/main/java/org/traccar/manager/MainActivity.java b/app/src/main/java/org/traccar/manager/MainActivity.java
index 2c44c87..7c2e876 100644
--- a/app/src/main/java/org/traccar/manager/MainActivity.java
+++ b/app/src/main/java/org/traccar/manager/MainActivity.java
@@ -28,7 +28,12 @@ public class MainActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
+ if (savedInstanceState == null) {
+ initContent();
+ }
+ }
+ private void initContent() {
String url = PreferenceManager.getDefaultSharedPreferences(this).getString(PREFERENCE_URL, null);
if (url != null) {
getFragmentManager().beginTransaction().add(android.R.id.content, new MainFragment()).commit();