aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/traccar/manager/MainActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/org/traccar/manager/MainActivity.java')
-rw-r--r--app/src/main/java/org/traccar/manager/MainActivity.java10
1 files changed, 10 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 c8d202d..2c44c87 100644
--- a/app/src/main/java/org/traccar/manager/MainActivity.java
+++ b/app/src/main/java/org/traccar/manager/MainActivity.java
@@ -18,13 +18,23 @@ package org.traccar.manager;
import android.app.Activity;
import android.os.Bundle;
+import android.preference.PreferenceManager;
public class MainActivity extends Activity {
+ public static final String PREFERENCE_URL = "url";
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
+
+ String url = PreferenceManager.getDefaultSharedPreferences(this).getString(PREFERENCE_URL, null);
+ if (url != null) {
+ getFragmentManager().beginTransaction().add(android.R.id.content, new MainFragment()).commit();
+ } else {
+ getFragmentManager().beginTransaction().add(android.R.id.content, new StartFragment()).commit();
+ }
}
}