From 3357de7e4ed379c6c8d40fbef3b37c1e86322dc7 Mon Sep 17 00:00:00 2001 From: Jesse Young Date: Mon, 19 Sep 2011 10:33:20 -0700 Subject: [PATCH] assume http:// scheme for server URLs --- src/org/envaya/kalsms/ui/Prefs.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/org/envaya/kalsms/ui/Prefs.java b/src/org/envaya/kalsms/ui/Prefs.java index 29c13dc..ef3e8f5 100755 --- a/src/org/envaya/kalsms/ui/Prefs.java +++ b/src/org/envaya/kalsms/ui/Prefs.java @@ -74,6 +74,16 @@ public class Prefs extends PreferenceActivity implements OnSharedPreferenceChang } else if (key.equals("server_url")) { + String serverUrl = sharedPreferences.getString("server_url", ""); + + // assume http:// scheme if none entered + if (serverUrl.length() > 0 && !serverUrl.contains("://")) + { + sharedPreferences.edit() + .putString("server_url", "http://" + serverUrl) + .commit(); + } + app.log("Server URL changed to: " + app.getDisplayString(app.getServerUrl())); } else if (key.equals("phone_number"))