List of usage examples for android.webkit URLUtil guessUrl
public static String guessUrl(String inUrl)
From source file:gr.ndre.scuttloid.ScuttleAPI.java
protected String getBaseURL() { return URLUtil.guessUrl(this.url); }
From source file:org.ohmage.authenticator.AuthenticatorActivity.java
/** * Ensures that the server url provided is valid. Once it is made valid, it * is set as the server url./*from w ww .j a va 2 s .c om*/ * * @return */ private boolean ensureServerUrl() { String text = mServerEdit.getText().toString(); if (TextUtils.isEmpty(text)) return false; // Assume they want https by default URI uri = URI.create(text.split(" ")[0]); if (uri.getScheme() == null) { text = "https://" + text; } text = URLUtil.guessUrl(text); if (URLUtil.isHttpsUrl(text) || URLUtil.isHttpUrl(text)) { mServerEdit.setText(text); return true; } return false; }