Issue
I have a WebView
in one of my Activities
where I want to load a Html
page. The page contains jquery-mobile
and some html
. So I do the following in my Activity
:
mWebView=(WebView) findViewById(R.id.MyWebView);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebViewClient(new WebViewClient(){
[...]
});
mWebView.loadUrl("http://www.mymobilepage.html");
The problem is that the page gets loaded and displayed on the emulator, and on a HTC Desire, but when I try to load it on a LG Optimus One nothing gets displayed. The events onPageStarted
and onPageFinished
both get fired in my WebViewClient
but just a blank page is displayed, and also I don't have any errors in my LogCat
.
Thanks in advance.
Solution
When onPageFinished is called, the page may not be completely rendered. The documentation states:
Notify the host application that a page has finished loading. This method is called only for main frame. When onPageFinished() is called, the rendering picture may not be updated yet. To get the notification for the new Picture, use onNewPicture(WebView, Picture).
However, note that onNewPicture is documented as deprecated and obsolete. I ask about a replacement/alternative here.
Answered By - ciscogambo
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.