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. For VS Code, look under vscode-webview.

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 API for Visual Studio Code

: 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.

22469 questions
66
votes
9 answers

Android WebView background color

I am adding to my layout a WebView to display justified text. I want to set the background of the WebView to be transparent to appear like a textView. Here's what I did: WebView…
Vervatovskis
  • 2,277
  • 5
  • 29
  • 46
65
votes
7 answers

Android: Disable text selection in a webview

I am using a webview to present some formatted stuff in my app. For some interaction (which are specific to certain dom elements) I use javascript and WebView.addJavascriptInterface(). Now, I want to recognize a long touch. Unfortunately,…
janoliver
  • 7,744
  • 14
  • 60
  • 103
64
votes
6 answers

Make Android WebView not store cookies or passwords

I use an Android WebView for Twitter OAuth: Twitter asks the user to log in and authorize the application, I retrieve the access token and persist it in my application. I have no need (and do not) store the user password, but the WebView keeps…
Thilo
  • 257,207
  • 101
  • 511
  • 656
64
votes
1 answer

AVD_loader.cpp: failed to get a service for display 4

I am trying to play audio through a WebView built which is built in Swift. Upon playing the audio, sometimes it will play out and other times it'll play for ~2 seconds and stop. I then get an error in the Xcode…
JDev
  • 5,168
  • 6
  • 40
  • 61
62
votes
8 answers

Textbox hidden below keyboard in Android webview

I have created a simple iPhone/Android app, containing a normal webview. This webview calls my website. On my website there are several forms with input type=text or textarea. I have a problem with those when they are at the bottom of the page! 1)…
andreas
  • 7,844
  • 9
  • 51
  • 72
62
votes
2 answers

Android webview crash "Fatal signal 5 (SIGTRAP)"

I have an app with a web view in which I load HTML content with JavaScript enabled. The web view is inside a fragment. This is how I initialize the web view inside the method onCreateView of the fragment : WebView webview = (WebView)…
Eddybrtn
  • 743
  • 5
  • 9
62
votes
5 answers

Check if Android WebView is consuming touch events

TL;DR How can I detect whether Android WebView consumed a touch event? onTouchEvent always returns true and WebViewClient's onUnhandledInputEvent is never triggered. Detailed description I have multiple WebViews inside a TwoDScrollView. As its name…
Miloš Černilovský
  • 3,846
  • 1
  • 28
  • 30
62
votes
10 answers

How to use custom font with WebView

Now I want to display some unicode characters and I have used tag: something here. But it seems that WebView can not find the Arial font because I can only see UFO-characters. Do I have to copy arial.ttf to somewhere or…
user164542
60
votes
11 answers

Android - local image in webview

I'm trying to diplay a local image in my webview : String data = "" + ""; webview.loadData(data, "text/html", "UTF-8"); This code doesn't display anything, instead of : …
Stéphane Piette
  • 5,341
  • 6
  • 34
  • 50
60
votes
5 answers

how to display progress while loading a url to webview in android?

I am loading url into webview: WebView webview=(WebView)findViewById(R.id.webview); webview.loadUrl(url); It's taking some time to load url, during which it shows a blank screen. I want to display a progress dialog while the url is…
sai
  • 2,562
  • 8
  • 31
  • 46
59
votes
8 answers

Tapping form field in WebView does not show soft keyboard

I created my own WebView and set the WebChromeClient and WebViewClient objects. When I start this WebView, the HTML form fields react when I touch them (a cursor appears), but they do not get selected, nor does the soft keyboard start. If I use the…
Shawn Lauzon
  • 6,234
  • 4
  • 35
  • 46
57
votes
14 answers

How to render a local HTML file with flutter dart webview

I want to render a local HTML file stored in my phone memory in webview using flutter and dart.
Abdoulaye BARRY
  • 737
  • 1
  • 7
  • 16
57
votes
2 answers

WebViewClient onReceivedError deprecated, new version does not detect all errors

In the Android SDK 23 onReceivedError(WebView view, int errorCode, String description, String failingUrl) has been deprecated and replaced with onReceivedError(WebView view, WebResourceRequest request, WebResourceError error). However if I put my…
Martin Epsz
  • 842
  • 1
  • 8
  • 16
57
votes
10 answers

Is there a better way to refresh WebView?

Ok. I have looked EVERYWHERE and my little brain just can't understand a better way to refresh an activity. Any suggestions that I can understand would be great. :) Here is the java code: package com.dge.dges; import android.app.Activity; import…
cdg
  • 583
  • 1
  • 5
  • 5
56
votes
4 answers

Open external links in the browser with android webview

I have this code, but not because it works, it keeps opening in webview and what I want is that the links do not belong to my website open in your default browser. Any idea? thanks private class CustomWebViewClient extends WebViewClient { …
Jaumesv
  • 1,065
  • 3
  • 11
  • 19