Questions tagged [webchromeclient]

WebChromeClient is an Android class to intercept JavaScript dialogs, loading progress, and other events.

WebChromeClient is an Android class to intercept a Webkit Webview's JavaScript dialogs, loading progress, and other events.

Resources

137 questions
287
votes
4 answers

What's the difference between setWebViewClient vs. setWebChromeClient?

What's the difference between setWebViewClient vs. setWebChromeClient in Android?
Pentium10
  • 204,586
  • 122
  • 423
  • 502
76
votes
2 answers

Are WebViewClient and WebChromeClient mutually exclusive?

From this great explanation about the differences between WebViewClient and WebChromeClient it seems that if you use one, you shouldn't be using the other (for the same WebView object). Is my understanding correct? If not, when would one use both…
ef2011
  • 10,431
  • 12
  • 49
  • 67
21
votes
3 answers

webChromeClient opens link in browser

I have searched and read a lot of posts but can not figure out how to do it in my code. I want to use geolocation in my app and need to view in webChromeClient in stead of webViewClient which I use for the html files now and the links does stay in…
Harry
  • 786
  • 1
  • 8
  • 27
19
votes
2 answers

Android WebView Playing HTML5/h.264/mp4 Video, How to get at the MediaPlayer

I have an Activity which is a WebView. I have a WebChromeClient inside it. Inside that, there are several callbacks which are meant to return the MediaPlayer handling the video bits. For example: @Override public void onPrepared(MediaPlayer mp) { …
Ted Collins
  • 710
  • 2
  • 8
  • 15
14
votes
4 answers

WebView + WebChromeClient method onCreateWindow not called for target="_blank"

I'm trying to develop a custom browser with WebView using Android API level 10 (sdk 2.3.3), unfortunately I don't know how to intercept request from the webpageto open URL in new browser window, like taps on links with target="_blank". In…
Lotzy
  • 489
  • 1
  • 6
  • 14
11
votes
4 answers

Android webview, File upload, crashes when setting result in onActivityResult

In Android webview, when file upload option is clicked, onShowFileChooser is called where intent for user to select file to upload from image gallery is invoked. after selecting file, inside onActivityResult it crashes due to following…
ked
  • 2,426
  • 21
  • 24
9
votes
2 answers

HTML 5 video crash when going fullscreen

I'm currently working on an application with screen orientation portrait, and i have html 5 video that need fullscreen support. I added to the webview a WebChromeClient, overrided few methods. Everything is working fine when i stick to the portrait…
8
votes
2 answers

Android video WebView FullScreen not working - onShowCustomView() not called

I'm trying to load a video URL in a WebView in android using the example in this project: https://github.com/hanksudo/android-webview-youtube-fullscreen Thing is the onShowCustomView method is never called. Whenever I click on the full screen button…
7
votes
0 answers

I/chromium﹕ [INFO:CONSOLE(1)] "Uncaught ReferenceError: callJS is not defined"

I'm getting the following error in Android Studio logcat: I/chromium﹕ [INFO:CONSOLE(1)] "Uncaught ReferenceError: callJS is not defined" I have researched on stackoverflow and tried the suggested answers on similar post with no luck. here I'm trying…
knlklabacka
  • 71
  • 1
  • 6
6
votes
4 answers

Android WebView WebChromeClient : inaccurate progress value in onProgressChanged()

I need to access the progress value in WebView -> WebChromeClient -> onProgressChanged(). The progress integer value doesn't increment from 0 to 100 but rather jumps around. Here is a sample log-output from loading one page and the associated…
tamsler
  • 1,275
  • 1
  • 18
  • 26
5
votes
1 answer

How do I detect when a WebView page is trying to close?

I have a WebView into which I'm loading the facebook sharer php page. This page doesn't have any form of confirmation, it simply closes the window once the user has either shared or cancelled. Since it is loaded into a web view there is nothing to…
Yevgeny Simkin
  • 27,946
  • 39
  • 137
  • 236
5
votes
1 answer

Android WebView new window null URLs on relative links

I have implemented a custom WebView with setSupportMultipleWindows() enabled. As such, I also have a custom WebChromeClient that overrides onCreateWindow() For most uses, I was using the following snippet to retrieve the URL for a page in a new…
najm
  • 834
  • 1
  • 13
  • 32
4
votes
2 answers

Android WebView not showing header bars or floating buttons

I have an Android WebView where I want to show a page, but certain elements of the page are not showing up. Since its a work related page and you need an account to access it but its hosted in Microsoft Sharepoint. On picture 1 (left) is my WebView…
Richard
  • 1,087
  • 18
  • 52
4
votes
0 answers

How to get the window features passed in via window.open for Android WebView?

When the following JS is run within Android WebView: window.open("http://www.stackoverflow.com", "foo", "left=10,top=10,width=100,height=100") I get the WebChromeClient's onCreateWindow that has isDialog=true. Is it not possible to get the values of…
crappie coder
  • 351
  • 3
  • 8
4
votes
4 answers

can't open file chooser in WebView Android 4.4.2 using WebChromeClient

In my webview by clicking "Choose File" button In samsung 7 inch tablet I want to open a File Browser, but I can't open this in Android Version 4.4.2. So can u plz help me for this? Here is my Code. WebViewDemo.java package…
1
2 3
9 10