diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-11-05 11:46:01 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-11-05 11:46:01 +1300 |
commit | 7422f1b2cb89019e8c43290246c49e3f27fad0fe (patch) | |
tree | 7379acf80c4997b8c5a2a0661cf23f091c2be55b /app | |
parent | 98db69bb2930a8928cd1dfb8cecf763c9c9f9c7c (diff) | |
download | etbsa-traccar-manager-android-7422f1b2cb89019e8c43290246c49e3f27fad0fe.tar.gz etbsa-traccar-manager-android-7422f1b2cb89019e8c43290246c49e3f27fad0fe.tar.bz2 etbsa-traccar-manager-android-7422f1b2cb89019e8c43290246c49e3f27fad0fe.zip |
Fix configuration change issue
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/org/traccar/manager/MainActivity.java | 5 |
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(); |