aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/build.gradle4
-rw-r--r--app/src/main/java/org/traccar/manager/MainFragment.kt8
-rw-r--r--app/src/main/java/org/traccar/manager/StartFragment.kt1
3 files changed, 9 insertions, 4 deletions
diff --git a/app/build.gradle b/app/build.gradle
index 2a1dd91..1a17eab 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -8,8 +8,8 @@ android {
applicationId 'org.traccar.manager'
minSdkVersion 19
targetSdkVersion 30
- versionCode 26
- versionName '2.15'
+ versionCode 27
+ versionName '2.16'
}
compileOptions {
diff --git a/app/src/main/java/org/traccar/manager/MainFragment.kt b/app/src/main/java/org/traccar/manager/MainFragment.kt
index 2675d0c..3f09e56 100644
--- a/app/src/main/java/org/traccar/manager/MainFragment.kt
+++ b/app/src/main/java/org/traccar/manager/MainFragment.kt
@@ -77,7 +77,13 @@ class MainFragment : WebViewFragment() {
webSettings.mediaPlaybackRequiresUserGesture = false
val url = PreferenceManager.getDefaultSharedPreferences(activity)
.getString(MainActivity.PREFERENCE_URL, null)
- url?.let { webView.loadUrl(it) }
+ if (url != null) {
+ webView.loadUrl(url)
+ } else {
+ activity.fragmentManager
+ .beginTransaction().replace(android.R.id.content, StartFragment())
+ .commitAllowingStateLoss()
+ }
}
private val broadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
diff --git a/app/src/main/java/org/traccar/manager/StartFragment.kt b/app/src/main/java/org/traccar/manager/StartFragment.kt
index ee379a2..536b22c 100644
--- a/app/src/main/java/org/traccar/manager/StartFragment.kt
+++ b/app/src/main/java/org/traccar/manager/StartFragment.kt
@@ -31,7 +31,6 @@ import android.widget.EditText
import androidx.preference.PreferenceManager
import org.json.JSONException
import org.json.JSONObject
-import org.traccar.manager.StartFragment
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader