Webview with progress and url overriding

by Chister Nordvik » Fri, 09 Oct 2009 14:10:38 GMT


Sponsored Links
 Hi!

I would like to add a Webview that both intercepts the URL clicks and
shows a progress when loading.

URL overriding:
myWebView.setWebViewClient(new WebViewClient() {
                    @Override public boolean shouldOverrideUrlLoading(WebView 
view,
String url) {
...

Progress:
myWebView.setWebChromeClient(new WebChromeClient(){
          @Override
          public void onProgressChanged(WebView view, int newProgress) {
...

But is there any way to combine these two? The WebViewClient only
offers OnPageFinished and then I can't show any real progress when
loading.

-Christer

--~--~---------~--~----~------------~-------~--~----~



Webview with progress and url overriding

by Mark Murphy » Fri, 09 Oct 2009 19:53:06 GMT


 


They are separate objects. What do you mean by "combined"?


What makes you say that? Is your WebChromeClient object being ignored?

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Warescription: Three Android Books, Plus Updates, $35/Year

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Webview with progress and url overriding

by cnordvik » Sat, 10 Oct 2009 04:13:24 GMT


 > What makes you say that? Is your WebChromeClient object being ignored?

Uh, well it seems like the website that I tested did a redirect so the
progress bar got a bit confused. It was working great actually. Just
thought the API was a bit strange with both a WebViewClient and a
WebChromeClient so I thought I did something wrong. Anyway, thanks for
replying to a confusing post :-)

-Christer
--~--~---------~--~----~------------~-------~--~----~



Webview with progress and url overriding

by Mark Murphy » Sat, 10 Oct 2009 04:21:24 GMT


 


Ah, yeah, redirects are somewhat annoying with WebView.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Looking for Android opportunities?  http://wiki.andmob.org/hado 

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. GridView zoom in/out

I have a GridView that displays thumbnails of images, I want to change
the thumbnail size (zoom in/out) during runtime, what is the best way
to achieve this ?

I changed the columnWidth of gridView during runtime but after that I
scroll the gridview and I get memoryoutoferror exception.

Thanks

-- 

2. Hate Parallel Kingdom spammers?

If your app is being spammed by users of Parallel Kingdom I suggest
you send the owners of the app an e-mail, perhaps eventually they will
get the message and stop this nonsense:

Official contact e-mail: tech-supp...@parallelkingdom.com
Company contact e-mail: contact...@perblue.com
CEO of perblue: jus...@perblue.com

My app, Radar Now! is getting spammed at least twice a day in the
comments. This really annoys the heck out of me and my users.

-John Coryat

-- 

3. Tanya aplikasi

4. Delete Call Log entry issue

5. Handler vs runOnUiThread

6. App2sd problem di spica

7. Opengl Direct/NonDirect Buffer