From 7422f1b2cb89019e8c43290246c49e3f27fad0fe Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 5 Nov 2016 11:46:01 +1300 Subject: Fix configuration change issue --- app/src/main/java/org/traccar/manager/MainActivity.java | 5 +++++ 1 file changed, 5 insertions(+) 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(); -- cgit v1.2.3