How do I can open this URL using webview in Android?
Asked
Active
Viewed 337 times
1
-
add code here that you are using already to load url – NehaK Sep 06 '18 at 17:13
-
Possible duplicate of [Android open URL in WebView](https://stackoverflow.com/questions/42759449/android-open-url-in-webview) – Dmytro Rostopira Sep 07 '18 at 07:14
2 Answers
0
Just like any other URL, but encode with UTF-8 to retain special characters.
URLEncoder.encode(URL, "utf-8");

Gokul Nath KP
- 15,485
- 24
- 88
- 126
0
XML WebView element in layout.
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
And then just do the following.
// ......
final String url = "<your link text>"
// ......
final WebView browser = (WebView) findViewById(R.id.webview);
browser.loadUrl(url );
// ......

GensaGames
- 5,538
- 4
- 24
- 53