aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/org/traccar/manager/MainActivity.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/src/main/java/org/traccar/manager/MainActivity.kt b/app/src/main/java/org/traccar/manager/MainActivity.kt
index 945b108..ce56296 100644
--- a/app/src/main/java/org/traccar/manager/MainActivity.kt
+++ b/app/src/main/java/org/traccar/manager/MainActivity.kt
@@ -33,11 +33,11 @@ class MainActivity : AppCompatActivity() {
}
private fun initContent() {
- if (PreferenceManager.getDefaultSharedPreferences(this).contains(PREFERENCE_URL)) {
- fragmentManager.beginTransaction().add(android.R.id.content, MainFragment()).commit()
- } else {
- fragmentManager.beginTransaction().add(android.R.id.content, StartFragment()).commit()
+ if (!PreferenceManager.getDefaultSharedPreferences(this).contains(PREFERENCE_URL)) {
+ PreferenceManager.getDefaultSharedPreferences(this)
+ .edit().putString(PREFERENCE_URL, getString(R.string.server_url)).apply()
}
+ fragmentManager.beginTransaction().add(android.R.id.content, MainFragment()).commit()
}
@RequiresApi(api = Build.VERSION_CODES.M)