webviewclient

Are WebViewClient and WebChromeClient mutually exclusive?

本秂侑毒 提交于 2019-11-28 03:14:55
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 WebViewClient and WebChromeClient for the same WebView object? Is there an example of a situation where only use both WebViewClient and WebChromeClient for the same WebView object would accomplish a certain goal? You certainly can use both, they just have different functions. Setting your own custom WebViewClient lets you handle onPageFinished,

Android : EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up

扶醉桌前 提交于 2019-11-27 22:12:23
I have implemented WebView in Dialog Activity and I am loading simple url into webview. my Webview settings are as wbView = (WebView) findViewById(R.id.wbView); wbView.setKeepScreenOn(true); wbView.getSettings().setJavaScriptEnabled(true); wbView.getSettings().setDomStorageEnabled(true); wbView.getSettings().setBuiltInZoomControls(true); wbView.setInitialScale(100); // wbView.getSettings().setUseWideViewPort(true); wbView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY); wbView.setWebViewClient(new MyWebViewClient()); and MyWebViewClient() contains private class MyWebViewClient extends

WebView loadUrl works only once

依然范特西╮ 提交于 2019-11-27 20:32:52
问题 EDIT: I worked on this project years ago and unfortunately I cannot verify if any of the answers is working in the given scenario. I am having hard time with one WebView which should show our blog. When initilized, it works just fine. The user can navigate to different links within the WebView. To get back to the blog, there is a button outside the WebView which should load the main blog site again. The problem is, that nothing is loaded after the second call to loadUrl. Here is my code:

Looking for Android ViewFlipper Example with Multiple WebViews

浪子不回头ぞ 提交于 2019-11-27 18:38:27
As I am sure you all know. Setting up a WebView is a matter of creating a webview browser client, setting properties and loading a resource into the browser client. I have created several android apps that do exactly that. What i would like to try now is horizontal swiping of different web resources. Imagine a main home page at one url, a categories page at another url and a search page at another url. I would like to create a UI construct that allows swiping from the main home page url view to a view displaying the categories url and then another swipe that shows the view with the search

Android - Open target _blank links in WebView with external browser

爷,独闯天下 提交于 2019-11-27 12:06:51
I build a WebView which displays a website. The website contains links without a target="_blank" attribute and some with it. I need to open the links with target defined in the external standard device browser and the ones without it inside the WebView. I'm using a WebViewClient and I tried around with this function but still all my links are opened within the WebView : Alternative 1: @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { return super.shouldOverrideUrlLoading(view, url); } Alternative 2: @Override public boolean shouldOverrideUrlLoading(WebView view,

Intercept and override HTTP requests from WebView

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 10:11:29
I have a WebView in my application in which some site is opened (always the same, it is my own page). The site has some JS code which loads some images from the remote host. I want to intercept requests to such images (by URL pattern) and give back my own content (i.e. another image), or leave request untouched depending on internal application logic. Is it possible to do that? EDIT : The current state of question... WebView has an ability to set a WebViewClient (as noted by Axarydax). WebViewClient have two useful methods shouldOverrideUrlLoading onLoadResource shouldOverrideUrlLoading is

Android - how to intercept a form POST in android WebViewClient on API level 4

十年热恋 提交于 2019-11-27 07:48:44
I have a WebViewClient attached to my WebView like so: webView.setWebViewClient(new MyWebViewClient()); Here is my implementation of MyWebViewClient : private class MyWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { webView.loadUrl(url); return true; } } I give the WebView a URL to load via loadUrl() . If I have a link ( a href... ) in the page, my shouldOverrideUrlLoading method is called and I can intercept the link click. However, if I have a form whose method is POST , the shouldOverrideUrlLoading method is not called. I

shouldOverrideUrlLoading in WebView for Android not running

那年仲夏 提交于 2019-11-27 07:00:27
-Edit: Solution Found- Figured it out after some heavy searching - one person (I literally mean one) said they instead used onPageLoad(); which worked perfectly for my purposes. The difference is that onPageLoad() runs later than shouldOverrideUrlLoading, but It doesn't make a difference in my code. I'm trying to set up Twitter authorization with OAuth for an Android app, and thus far I can successfully send the user to the authorization URL, however, what I am trying to do now is intercept the redirect to the callback (which would just lead to a 404 error, our callback URL isn't going to have

Android 4.4 giving ERR_CACHE_MISS error in onReceivedError for WebView back

筅森魡賤 提交于 2019-11-27 04:03:26
I have a webview in my Layout. By default, a search form is opened in it. On search, a listing section appears below the search form. If any link in the list is clicked, the details page opened. Now I want to controlled the back navigation for the webview. I placed this code in Activity. @Override public boolean onKeyDown(int keyCode, KeyEvent event) { Log.d("TYPE", TYPE); WebView myWebView = null; if (TYPE.equalsIgnoreCase("REPORT_ACTIVITY")) myWebView = reportView; if (TYPE.equalsIgnoreCase("FEEDBACK_ACTIVITY")) myWebView = feedbackView; if (myWebView != null) // Check if the key event was

Enabling specific SSL protocols with Android WebViewClient

不打扰是莪最后的温柔 提交于 2019-11-27 03:45:19
My application uses WebViewClient to make SSL connections to the server. The server is configured to only accept TLSv1.1 and above protocols. 1) How do I check which SSL protocols are a) Supported and b) Enabled by default when using Android WebViewClient on a device. 2) How do I enable specific SSL protocols for Android WebViewClient instance used in my application. On one of the test devices running Android 4.3, WebViewClient throws onReceivedError callback with description "Failed to perform SSL handshake" Chrome logs are as follows: 01-29 15:58:00.073 5486 5525 W chromium_net: external