Menu
  • HOME
  • TAGS

Do something if WebView url contains a string

android,webview,android-studio,webviewclient,webchromeclient

You have, webView.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { String url = webView.getUrl(); if (url.contains("string")) { code = url.substring(url.lastIndexOf("value=") + 6); dialog.dismiss(); //action } return false; } } Ref : http://developer.android.com/reference/android/webkit/WebViewClient.html#shouldOverrideUrlLoading(android.webkit.WebView,java.lang.String)...

Android webview javascript not working on API 18 or higher

javascript,android,webview,webviewclient

What @Mattia said is correct. Use evaluateJavascript if possible. It has another advantage of being able to return the value of the result back from JavaScript. But if you want an API-agnostic workaround, make sure that the code you evaluate using loadUrl("javascript:...") just doesn't produce any return value. An assignment...

Android Ask for permission to use location within webview

java,android,webview,webviewclient,webchromeclient

That's because you need to create the prompt. The onGeolocationPermissionsShowPrompt function is simply called to let you know the webpage wants the location. callback.invoke(origin, true, false); is the response telling the WebView it's OK to use the location. The last argument is whether or not to remember this setting. See:...

My WebViewClient is refreshing in a loop

android,loops,webviewclient

You are reloading page in onPageFinished event with view.loadUrl(url); onPageFinished is triggered when page has finished loading and you should not reload the page inside that event or you will end up in endless loop....

WebViewClient returning “Couldn't establish a secure connection.” upon recreating the fragment

android,webviewclient

This appears to be a bug in Android v4.3 and earlier, which now Google are not maintaining will not be patched. The website we are connecting to is running TLS but has recently switched off SSLv3. It's a payment provider and PCI compliance is forcing providers to disable both SSLv3...

The method onReceivedError(WebView, int, String, String) is undefined for the type WebChromeClient

android,webview,android-webview,webviewclient

Yes. That's because it's defined on WebViewClient, not WebChromeClient. http://developer.android.com/reference/android/webkit/WebViewClient.html#onReceivedError(android.webkit.WebView, int, java.lang.String, java.lang.String)

create webview on top of the other layouts which fits to screen

android,webview,android-webview,webviewclient

Create a FrameLayout and place your LinearLayout and WebView in it. Since in FrameLayout Child views are drawn in a stack. you will have both the views overlapping on each other. control their visibility to switch between your views.

unable to clear login information in Webview

android,android-webview,webviewclient

You did everything okay, but you need to delete the cookies as well CookieSyncManager.createInstance(getActivity()); CookieManager cookieManager = CookieManager.getInstance(); if(Build.VERSION.SDK_INT >= 21) { cookieManager.removeAllCookies(new ValueCallback<Boolean>() { @Override public void onReceiveValue(Boolean aBoolean) { } }); } else{ cookieManager.removeAllCookie(); } This is how you would disable them alltogether CookieSyncManager.createInstance(getActivity()); CookieManager cookieManager = CookieManager.getInstance();...

How to add custom error page when there is no internet connection available

android,webview,android-webview,webviewclient

i got solution by adding below code mWebView.setWebViewClient(new MyWebViewClient() { public void onReceivedError(WebView webview, int i, String s, String s1) { mWebView.loadUrl("file:///android_asset/error.html"); } }); put your own html error page in assets folder...

Not getting progress bar in webview

android,webview,android-webview,webviewclient

Here is the Modified Java File and Also The XML.. The Java File is DroidWebViewActivity and The XML File... XML File Hope it works for you. Thanks...

Calculating data downloaded by webview for a given url by using webview client?

android,android-webview,webviewclient

Tons of stuff might be happening. The WebView might be getting resources from cache for example, the progress could be reflecting loads of data: URLs, etc.. The onProgressChanged API was only intended to drive a progress bar, so the values you get from it should be treated as a 'best...

Android WebView Intent send email with “to” pre-filled

android,android-intent,webview,webviewclient

This is how I did it using the MailTo class: MailTo mailTo = MailTo.parse(url); Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_EMAIL, new String[]{mailTo.getTo()}); intent.putExtra(Intent.EXTRA_TEXT, mailTo.getBody()); intent.putExtra(Intent.EXTRA_SUBJECT, mailTo.getSubject()); intent.putExtra(Intent.EXTRA_CC, mailTo.getCc()); intent.setType("message/rfc822"); startActivity(intent); ...