How to use WebView in Offline mode? Can I dynamically revoke permissions?

by Mariano Kamp » Wed, 21 Apr 2010 02:17:51 GMT

Sponsored Links

I am want to use JavaScript to process some HTML pages in the background.

WebView seems to be a great basis to do this. There is one issue though. I
don't want to display the web page and its images/stylesheets right away, so
it is a waste of bandwidth when the stylesheets and images are downloaded. I
am wondering how to tell WebView not to do that.

I tried WebSettings.setLoadsImagesAutomatically(false), but this still loads
the stylesheets. WebView.setNetworkAvailable(false) is more an information
for WebView than a switch. Overriding
WebViewClient.shouldOverrideUrlLoading(..) didn't work either.

Any idea how to do this?

One thing that works is not giving the app the required Internet permission.
Unfortunately it is not that simple, because at other times I want to
display the processed pages and then it should download the
images/stylesheets ;-( But still is there some way that I can use this
permission thing? Can I dynamically revoke the permission? For a single
thread or process?




How to use WebView in Offline mode? Can I dynamically revoke permissions?

by Mariano Kamp » Wed, 21 Apr 2010 03:39:17 GMT


Sounds good. I will try that.


Sponsored Links

Other Threads

1. Subscribe to onDialogClosed

Can anyone give me an example or explain to me how i subscribe to the
onDialogClosed method of an EditTextPreference?

I want to know when a dialog have had its OK or Cancel button clicked
and retrive the information from the EditText.

Is there any examples/tutorials of this available or can anyone point
me in the right direction?


2. How to cancel Android Market developer account

Hi, I just responded to your post on the Market "Support" Forum as well.

What do you mean they used the wrong ID?

Nope! Welcome to Android Development! Enjoy your stay.

TreKing - Chicago transit tracking app for Android-powered devices


3. listview doesnt repaint inside gallery when scrolling at random times

4. Is there a place to write temporary files

5. Avoid Black Screen on starting application?

6. Platform 1.1 gone?

7. DatePicker - years prior to 2000