mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 09:29:02 +02:00
Add hifi scheme for scheme-less addresses
This commit is contained in:
parent
20acfdfb82
commit
ffb38eb490
1 changed files with 13 additions and 0 deletions
|
@ -12,6 +12,9 @@ import android.view.View;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
public class GotoActivity extends AppCompatActivity {
|
public class GotoActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private EditText mUrlEditText;
|
private EditText mUrlEditText;
|
||||||
|
@ -53,6 +56,16 @@ public class GotoActivity extends AppCompatActivity {
|
||||||
private void actionGo() {
|
private void actionGo() {
|
||||||
String urlString = mUrlEditText.getText().toString();
|
String urlString = mUrlEditText.getText().toString();
|
||||||
if (!urlString.trim().isEmpty()) {
|
if (!urlString.trim().isEmpty()) {
|
||||||
|
URI uri;
|
||||||
|
try {
|
||||||
|
uri = new URI(urlString);
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (uri.getScheme()==null || uri.getScheme().isEmpty()) {
|
||||||
|
urlString = "hifi://" + urlString;
|
||||||
|
}
|
||||||
|
|
||||||
Intent intent = new Intent(this, InterfaceActivity.class);
|
Intent intent = new Intent(this, InterfaceActivity.class);
|
||||||
intent.putExtra(InterfaceActivity.DOMAIN_URL, urlString);
|
intent.putExtra(InterfaceActivity.DOMAIN_URL, urlString);
|
||||||
finish();
|
finish();
|
||||||
|
|
Loading…
Reference in a new issue