How do I can open this URL using webview in Android?
Asked
Active
Viewed 273 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) – Dima 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
- 14,745
- 24
- 85
- 122
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,238
- 3
- 20
- 50