I have a webview which I like to be transparent, until the first page
loads. I set it transparent like so:
mWebView.setBackgroundColor(0);
then I set it to use this WebViewClient
private class OurWebViewClient extends WebViewClient {
public void onPageFinished(WebView view, String url){
EmbeddedWebViewWithFooter.this.runOnUiThread(new Runnable(){
public void run() {
mWebView.setBackgroundColor(Color.WHITE);
mWebView.setVisibility(View.VISIBLE);
mWebView.invalidate();
Log.d(this.getClass().getCanonicalName(),"set visible and white
background");
}
});
}
to give it again a whiteBackground and make it visible.
In the logs I see the log statement, verifying it should have a white
background. However sometimes the page loads with a transparent
background. It's inconsistent, and it led me to wonder if it was a
threading issue or race condition.
I have experiment instead of running on the UIThread, and with
posInvalidate. No matter what I try it still sometimes appears
transparent, even though I see log statements verifying
mWebView.setBackgroundColor(Color.WHITE) was called on the UiThread,
and invalidate was called.
Any advice? It looks like a bug to me.
-MK
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---