aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/traccar/manager/StartFragment.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-05 19:54:31 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-05 19:54:31 +1300
commitdeba5e0a98bfed80d48630b4ebc81480d68d9ec6 (patch)
tree27b9cd33b03866fc58fc032279451b5d7b3cac21 /app/src/main/java/org/traccar/manager/StartFragment.java
parentb2f116b1579c95108885309a302ac270a4d0fab2 (diff)
downloadetbsa-traccar-manager-android-deba5e0a98bfed80d48630b4ebc81480d68d9ec6.tar.gz
etbsa-traccar-manager-android-deba5e0a98bfed80d48630b4ebc81480d68d9ec6.tar.bz2
etbsa-traccar-manager-android-deba5e0a98bfed80d48630b4ebc81480d68d9ec6.zip
Better way of constructing url
Diffstat (limited to 'app/src/main/java/org/traccar/manager/StartFragment.java')
-rw-r--r--app/src/main/java/org/traccar/manager/StartFragment.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/src/main/java/org/traccar/manager/StartFragment.java b/app/src/main/java/org/traccar/manager/StartFragment.java
index 6d41fb2..429e8d1 100644
--- a/app/src/main/java/org/traccar/manager/StartFragment.java
+++ b/app/src/main/java/org/traccar/manager/StartFragment.java
@@ -18,6 +18,7 @@ package org.traccar.manager;
import android.app.AlertDialog;
import android.app.Fragment;
import android.content.DialogInterface;
+import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
@@ -63,7 +64,8 @@ public class StartFragment extends Fragment implements View.OnClickListener {
protected Boolean doInBackground(String... urls) {
try {
- URL url = new URL(urls[0] + "/api/server");
+ Uri uri = Uri.parse(urls[0]).buildUpon().appendPath("api/server").build();
+ URL url = new URL(uri.toString());
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));