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. In-app Billing Test

Hi All

I cannot execute the app the test "dungeon test" .
http://developer.android.com/intl/de/guide/market/billing/billing_testing.html#billing-testing-real

Appears the following error:
The market billing service is not available at this time. You can continue
to use this app but you won't be able to make purchases

I have the last version from market 2.3.6 and android 2.2 my handset is
Motorola A893, my country is Peru and my account is from the denmark, my
account is the developer account

What is the problem?

Thanks
David

-- 

2. aapt.exe takes minutes to complete in eclipse build.

Since I've updated to api level 11, it seems that building is super
slow.

Sometimes when eclipse is building the project it hangs at 'android
library update' for minutes at a time, and process explorer shows
appt.exe pegging my CPU.

I've tried all the workarounds I could find by googling.
-- setting -Dosgi.requiredJavaVersion=1.6 for Helios
-- increasing the memory settings
-- switching to Gallileo


The only thing that seems to make it go away is changing the build
target to less that api 11, which causes my project to not compile,
but at least it gets past the 'library update' step.

How can I figure out what aapt is doing for so long so I can try and
mitigate this?

I didn't see anything in the eclipse logs that pointed to this.

What other options do I have to determine what's going on?

-- 

3. Limit for number of strings in res/values/strings.xml

4. Ang.: 2.3 Platform Google APIs missing Licensing Service..?

5. Error: Fragment already added

6. Ported Android 2.3.4 to KZM-A9-Dual board (Cortex-A9 dual core SMP)

7. Google I/O Report - Google Rilis Music App Untuk Saingi iTunes