I got the same problem as yours.
In the example I got for the first time, as I use WebChromeClient as
WebViewClient,
when setting
mWebView.setWebChromeClient(new MyWebChromeClient());
it seems every time I click next, it loads the page to a browser
instead of WebView.
So it becomes what the problem is.
To redirect the page to WebView, I replace the WebViewClient like:
mWebView.setWebViewClient(new MyWebViewClient());
And also you should override the function shouldOverrideUrlLoading(),
make it something like:
final class MyWebViewClient extends WebViewClient {
@Override
// Show in WebView instead of Browser
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
view.loadUrl(url);
return true;
}
}
And then the problem fixed.
But I got another problem here...
Even if I fixed the table's width and height in HTML, but in the
WebView,
it always shrinks to fit the content in that page. Which means the
layout I designed in HTML
is corrupted in WebView.....
I'm not sure if this is because what I've done above.
On 3月26日, 午前1:52, Brian <[email protected]> wrote:
> I am working on an app that useswebviewfor a help section. The help
> section is loaded from an external site, that is specifically designed
> for mobile phones. There are a series of 5 pages, with a simple next/
> back navigation. When the first page loads, it loads perfectly,
> filling the entire area of the screen. When you click next, the page
> is now smaller with a large white gap around it (right and bottom),
> when I click back to the first page, this page now is displaying the
> same way (gap around it). I have tried setting body/table/container
> divs to 100% wide, and this continues to happen. However it works
> perfectly on any desktop browser.
>
> This happens on the droid/nexus one.
>
> It almost seems as if clicking next is resetting something in
> thewebviewsettings, but I don't know what it would be or why?
>
> Any help or ideas would be appreciated.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
To unsubscribe, reply using "remove me" as the subject.