Tag: webview

How to control memory usage when calling multiple WebView in Android?

My app’s main activity is a Activity that contains a Webview to load web pages. I override the method shouldOverrideUrlLoading(WebView view, String url) to make every URL request call up an Intent and load in a new same activity containing WebView. Doing this is to provide a better experience when BACK key is pressed, will […]

How to get full cookies data from an Android WebView?

I have an Android app that uses a WebView. I’m trying to get all cookies with all of their data including their “path” data, “max-age”, “hostOnly” flag and “secure” flags (like in Google Chrome’s chrome.cookies.getAll() extension API). CookieManager.getCookie() only returns name and value pairs of the cookies. Any idea of how can I extract all […]

Pause WebView video instead of whole WebView

I have a WebView with youtube video and 3 tabs. YouTube video is available in 1st Tab while in other 2 tabs there is a content. Now i want to pause a video when user moves to other tabs. I have tried with webView.onPause(); and Class.forName(“android.webkit.WebView”) .getMethod(“onPause”, (Class[]) null) .invoke(webView, (Object[]) null); but it is […]

Android WebView New Window URL

I’ve got an issue with Android WebView, I want to open a URL with target=’_blank’ in the same WebView, just as all other URLs are opening. Also note that im overriding this method of WebViewClient ‘shouldOverrideUrlLoading‘, for handling URL redirects (so that all URL redirects are opened in my WebView) but in case of URLs […]

Why I cannot set currentTime and duration is equal 0 in HTML AudioElement in Android WebView?

Please forgive me, but as I was writing this question, some ideas came up, so the question may look as a log of events, but you can safely skip to the TL;DR part. I have an AAR module in which I use a WebView to display a page and play audio files with different start […]

Android: Playing an Asset Sound Using WebView

I am trying to play a sound from the assets folder when a user clicks on an tag on my application’s WebView. I found that I can use a new class extending WebViewClient to detect the extension of a link and if it is an mp3 file it can play it via the default Audio […]

How to stop INTERNAL scrolling of WebView in Android?

I have a WebView in my application which has HTML content rendered in it and size of HTML content is larger than size of WebView. Due to which content is scrolling inside it when user drags his/her finger on it. I want to stop this INTERNAL scrolling being happening with content. Heres what I have […]

How to make a replacement over the webs loaded in a Webview

I’m implementing an app using a webview. For the urls loaded in the webview I’d need to perform a replacement over the html code loaded in the url. How can I do this in a efficient way? Explanation: I need to replace an specific script script from the source: In example: I want to <html> […]

WebView – can't download file without requesting it twice?

If I listen with DownloadListener, I get the URL which I need to request after the browser already requested it. The browser already opened a connection to the URL (which is how it knows this is a download), why can’t it pass me the connection? I also tried to assign a custom WebViewClient to the […]

android webview page reloading after capture picture and Upload in android 5+

I followed this to capture Images form camera in webview Here at this part its fine in android some versions and in some devices its working fine But at android 5.0.1 when I capture image from webview its capturing and reloading the page again in that I am again redirecting to Login page So i […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.