aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/traccar/manager/MainActivity.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-05 11:43:18 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-05 11:43:18 +1300
commit98db69bb2930a8928cd1dfb8cecf763c9c9f9c7c (patch)
tree8a668b36b875f95828309ae4076c646a5bba01ee /app/src/main/java/org/traccar/manager/MainActivity.java
parentb5375c8832963070917d572ed520345f75f1b9a8 (diff)
downloadetbsa-traccar-manager-android-98db69bb2930a8928cd1dfb8cecf763c9c9f9c7c.tar.gz
etbsa-traccar-manager-android-98db69bb2930a8928cd1dfb8cecf763c9c9f9c7c.tar.bz2
etbsa-traccar-manager-android-98db69bb2930a8928cd1dfb8cecf763c9c9f9c7c.zip
Add first start screen
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();
+ }
}
}