aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-14 22:30:58 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-14 22:30:58 +1300
commitc7a01cdbd3aee241981a6ecb7d1b1f9ec786cfaf (patch)
tree1fc99c8ca150aa5ef8099a4efc1a7904ea585ec0 /app
parentdeba5e0a98bfed80d48630b4ebc81480d68d9ec6 (diff)
downloadetbsa-traccar-manager-android-c7a01cdbd3aee241981a6ecb7d1b1f9ec786cfaf.tar.gz
etbsa-traccar-manager-android-c7a01cdbd3aee241981a6ecb7d1b1f9ec786cfaf.tar.bz2
etbsa-traccar-manager-android-c7a01cdbd3aee241981a6ecb7d1b1f9ec786cfaf.zip
Minor updates and fixes
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/org/traccar/manager/MainFragment.java3
-rw-r--r--app/src/main/java/org/traccar/manager/StartFragment.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/java/org/traccar/manager/MainFragment.java b/app/src/main/java/org/traccar/manager/MainFragment.java
index d63c19e..3f38bbb 100644
--- a/app/src/main/java/org/traccar/manager/MainFragment.java
+++ b/app/src/main/java/org/traccar/manager/MainFragment.java
@@ -109,7 +109,8 @@ public class MainFragment extends WebViewFragment {
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
Uri uri = Uri.parse(url);
- if (uri.getHost().equals("cdnjs.cloudflare.com")) {
+ String host = uri.getHost();
+ if (host != null && host.equals("cdnjs.cloudflare.com")) {
String path = uri.getPath().substring("/ajax/libs".length());
try {
return loadFileFromAssets(url, "cdnjs" + path);
diff --git a/app/src/main/java/org/traccar/manager/StartFragment.java b/app/src/main/java/org/traccar/manager/StartFragment.java
index 429e8d1..f56d7e8 100644
--- a/app/src/main/java/org/traccar/manager/StartFragment.java
+++ b/app/src/main/java/org/traccar/manager/StartFragment.java
@@ -64,7 +64,7 @@ public class StartFragment extends Fragment implements View.OnClickListener {
protected Boolean doInBackground(String... urls) {
try {
- Uri uri = Uri.parse(urls[0]).buildUpon().appendPath("api/server").build();
+ Uri uri = Uri.parse(urls[0]).buildUpon().appendEncodedPath("api/server").build();
URL url = new URL(uri.toString());
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));