From 98db69bb2930a8928cd1dfb8cecf763c9c9f9c7c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 5 Nov 2016 11:43:18 +1300 Subject: Add first start screen --- app/src/main/java/org/traccar/manager/MainActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/src/main/java/org/traccar/manager/MainActivity.java') 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(); + } } } -- cgit v1.2.3