Questions tagged [android-webview]

Part of the Android API. A View that displays web pages. This class is the basis upon which you can roll your own web browser or simply display some online content within your Activity.

A View that displays web pages. This class is the basis upon which you can roll your own web browser or simply display some online content within your Activity. It uses the WebKit rendering engine to display web pages and includes methods to navigate forward and backward through a history, zoom in and out, perform text searches and more.

Apart loading from the web, this component supports loading from assets (location file:///android_asset/, this folder must be called "assets" and be present in the project root) or other arbitrary folder. It also supports JavaScript but it is disabled by default and must be explicitly turned on.

Documentation for WebView.

7462 questions
57
votes
4 answers

android: webview inside dialog or popup

how to add web view inside dialog or popup window. my web view hold URL WebView.loadurl() .when view added inside dialog it still moving to the browser. I've been in android loading webview in dialog but is no example of how to do it? thanks
roy.d
  • 1,030
  • 2
  • 16
  • 33
56
votes
11 answers

Android WebView not loading URL

I want to load the URL in WebView I have used the following Code: webView = (WebView) findViewById(R.id.webview1); webView.setWebViewClient(new…
String
  • 3,660
  • 10
  • 43
  • 66
53
votes
11 answers

Android WebView, Scaling Image to fit the screen

What I have: I'm loading image from a URL. I simply do (WebView).loadUrl(imageurl, extraheaders) What I get: Image is not showing at full width of the WebView, it has blank space all around (like if you open a little iamge in your desktop…
artouiros
  • 3,947
  • 12
  • 41
  • 54
51
votes
8 answers

How to add padding around a WebView

My layout file defines a WebView, underneath which there are some fixed height buttons.
Dan J
  • 25,433
  • 17
  • 100
  • 173
51
votes
5 answers

How to enable javascript into webView

In android if I use javascript into webView it gives Force Close. Is there any possibilities for using java script into webView. please help... 01-10 10:08:51.513: W/dalvikvm(5994): JNI WARNING: jarray 0x407447a8 points to non-array object…
Dhanesh
  • 781
  • 2
  • 9
  • 16
49
votes
7 answers

How to get loaded web page title in Android WebView?

I'm using a WebView in my application, I have a requirement to change the app title based on the page user is on. How can I do this in Android WebView? I did this in iphone by following line self.title = [webPage…
Sam
  • 6,215
  • 9
  • 71
  • 90
49
votes
6 answers

How to debug webview remotely?

How can I do debug/inspect element of apk webview. I have tried this but it is helpful only for chrome not for apk. Please suggest me
Kundan Atre
  • 3,853
  • 5
  • 26
  • 39
48
votes
4 answers

Caching in Android webview

Which one is faster way to load mobile web pages and non mobile web pages in Android webview; loading cache or not loading that at all? And what is recommend style to load that? Right now when I don't load cache at all non mobile sites are much more…
Eljas
  • 1,187
  • 4
  • 17
  • 37
48
votes
2 answers

Loading an Android Resource into a WebView

I have an Android app that displays a comic book. To make use of the built-in zoom controls, I am loading the pictures in a WebView like so: webView.loadUrl("file:///android_asset/page1.jpg"); This is working just fine, however, since the images…
Amplify91
  • 2,690
  • 5
  • 24
  • 32
47
votes
8 answers

Android WebView JellyBean -> Should not happen: no rect-based-test nodes found

My application is using a lot of webviews which are lying in fragments which are hold by a ViewPager. Whenever i swipe through the app on my Galaxy Nexus with Jellybean on it i get the following console message again and again: 08-23 13:44:03.374:…
Ostkontentitan
  • 6,930
  • 5
  • 53
  • 71
46
votes
4 answers

WebView Crash on Android 5-5.1 (API 21-22) Resources$NotFoundException: String resource ID #0x2040002

I am in the process of updating an Android app from API 27 to API 29 and I noticed that I get a crash when trying to render a WebView on an emulator based on 5.0 and/or 5.1. This issue does not happen on an emulator running 6.0 or higher (API…
JPM
  • 1,482
  • 5
  • 18
  • 25
46
votes
9 answers

How to override default text selection of android webview os 4.1+?

Before posting this question I've searched a lot but could not find any clear answers on this issue. I have to override default text selection of android webview & show my custom text selection dialog options. I have tried this sample code…
sachin003
  • 8,983
  • 4
  • 21
  • 23
46
votes
11 answers

YouTube Video not playing in WebView - Android

I am tying to play YouTube video in WebView, WebView showing first look of video with play button, But after click on play button start progress bar and after 2-3 seconds stop progress bar and screen blank with black color. Image1: Video first look…
Ranjitsingh Chandel
  • 1,479
  • 6
  • 19
  • 33