#21 not sure if I need to type in http/https – it should work without any protocol prepended, and try with https by default

This commit is contained in:
Stefan Niedermann 2015-10-23 00:05:32 +02:00
parent 581e301635
commit 990d8f682c

View file

@ -59,6 +59,9 @@ public class SettingsActivity extends AppCompatActivity {
@Override @Override
public void onTextChanged(CharSequence s, int start, int before, int count) { public void onTextChanged(CharSequence s, int start, int before, int count) {
String url = ((EditText) findViewById(R.id.settings_url)).getText().toString(); String url = ((EditText) findViewById(R.id.settings_url)).getText().toString();
if (!url.startsWith("http://") && !url.startsWith("https://")) {
url = "https://" + url;
}
new URLValidatorAsyncTask().execute(url); new URLValidatorAsyncTask().execute(url);
if (NotesClientUtil.isHttp(url)) { if (NotesClientUtil.isHttp(url)) {
@ -88,7 +91,10 @@ public class SettingsActivity extends AppCompatActivity {
if (!url.endsWith("/")) { if (!url.endsWith("/")) {
url += "/"; url += "/";
} }
if (!url.startsWith("http://") && !url.startsWith("https://")) {
url = "https://" + url;
}
Log.v("Note", "URL: " + url);
new LoginValidatorAsyncTask().execute(url, username, password); new LoginValidatorAsyncTask().execute(url, username, password);
} }
}); });