Questions tagged [webview]

Elements in graphical user interfaces that host HTML content. For Android, look at the android-webview tag. For iOS, look under uiwebview or wkwebview.

A user interface element that displays web pages. Generally, it is the basis upon which you can roll your own web browser or simply display some online content within your application.

: WebView class reference for Android

: WKWebView class reference for iOS

: UIWebView class reference for iOS (deprecated)

: WebView that is used in Ionic

WebView class reference for macOS (deprecated)

webview tag reference for Chrome apps

WebView: a Node that displays WebEngine content.

21017 questions
264
votes
8 answers

Android Calling JavaScript functions in WebView

I am trying to call some javascript functions sitting in an html page running inside an android webview. Pretty simple what the code tries to do below - from the android app, call a javascript function with a test message, which inturn calls a java…
user163757
  • 6,285
  • 8
  • 27
  • 43
255
votes
7 answers

Android webview & localStorage

I have a problem with a webview which may access to the localStorage by an HTML5 app. The test.html file informs me that local storage is'nt supported by my browser (ie. the webview). If you have any suggestion.. package com.test.HelloWebView;…
Thomas
  • 8,159
  • 3
  • 14
  • 7
218
votes
7 answers

How to check if a file exists in Documents folder?

I have an application with In-App Purchase, that when the user buy something, download one html file into the Documents folder of my app. Now I must check if this HTML file exists, so if true, load this HTML file, else load my default html page. How…
Obliviux
  • 2,639
  • 4
  • 19
  • 11
187
votes
9 answers

Android Webview gives net::ERR_CACHE_MISS message

I built a web app and wants to create an android app that has a webview that shows my web app. After following the instructions from Google Developer to create an app, I successfully installed it on my phone with Android 5.1.1. However, when I run…
zehata
  • 2,484
  • 2
  • 12
  • 23
184
votes
19 answers

File Upload in WebView

I have been struggling to upload files from WebView since last few days and there is no progress. I googled and implemented all suggested solutions but none works, like: solutions suggested here, and so on. Problem: I have a HTML page with the…
user741148
  • 1,859
  • 3
  • 12
  • 6
179
votes
10 answers

Android webview slow

My android webviews are slow. This is on everything from phones to 3.0+ tablets with more than adequate specs I know that webviews are supposed to be "limited" but I see web apps done with phone gap that must be using all sorts of CSS3 and JQuery…
CQM
  • 36,672
  • 69
  • 214
  • 357
176
votes
7 answers

jQuery get the location of an element relative to window

Given an HTML DOM ID, how to get an element's position relative to the window in JavaScript/JQuery? This is not the same as relative to the document nor offset parent since the element may be inside an iframe or some other elements. I need to get…
adib
  • 7,718
  • 6
  • 46
  • 85
168
votes
23 answers

Android WebView style background-color:transparent ignored on android 2.2

I'm struggling to create a WebView with transparent background. webView.setBackgroundColor(0x00FFFFFF); webView.setBackgroundDrawable(myDrawable); Then I load a html page with
jptsetung
  • 8,668
  • 3
  • 38
  • 49
164
votes
10 answers

Swift Open Link in Safari

I am currently opening the link in my app in a WebView, but I'm looking for an option to open the link in Safari instead.
Fabian Boulegue
  • 6,024
  • 14
  • 45
  • 70
154
votes
4 answers

How to pass html string to webview on android

Hi I am parsing xml and then loading it to web view, after parsing I am creating four strings so that I could append all string to one view. I am able to get two views on the web view but not the first two strings. Pls suggest me with my code,…
cavallo
  • 4,124
  • 9
  • 36
  • 59
149
votes
4 answers

Is `shouldOverrideUrlLoading` really deprecated? What can I use instead?

Is "shouldOverrideUrlLoading" really deprecated? If so, what can I use instead? It seems like shouldOverrideUrlLoading is deprecated targeting Android N and I need to make an app work since API 19 until the latest right now which is Android N…
Minion
  • 2,287
  • 3
  • 23
  • 28
148
votes
20 answers

Android WebView: handling orientation changes

The issue is the performance following rotation. The WebView has to reload the page, which can be a bit tedious. What's the best way of handling an orientation change without reloading the page from source each time?
glennanthonyb
  • 1,815
  • 2
  • 14
  • 10
142
votes
20 answers

android.view.InflateException Error inflating class android.webkit.WebView

In Lollipop (API 22) every time in my application I show a webview the application crashes. I have multiple crashes in my android developer console related to this event. No need to say that it works on Android 4, 6 and 7. Reading the stack trace…
Valerio
  • 2,472
  • 3
  • 20
  • 31
137
votes
6 answers

How to enable zoom controls and pinch zoom in a WebView?

The default Browser app for Android shows zoom controls when you're scrolling and also allows for pinch zooming. How can I enable this feature for my own Webview? I've tried:…
Robert Bana
  • 1,995
  • 3
  • 14
  • 23
127
votes
12 answers

how to get html content from a webview?

Which is the simplest method to get html code from a webview? I have tried several methods from stackoverflow and google, but can't find an exact method. Please mention an exact way. public class htmldecoder extends Activity implements…
user765970
1
2 3
99 100