Issue
I am trying to do something very simple at the initialization of a WebView instance, such that the plain background color is replaced by an image (drawable) until some lengthy operation completes (which then loads a web page, of course). I am trying to accomplish this with:
myWebView.setBackgroundResource(R.drawable.myImage);
Android doesn't complain about anything but it doesn't display the image.
If I replace the above with:
myWebView.setBackgroundColor(Color.parseColor("#123456"));
The background color takes effect without any problem.
What am I missing? What am I doing wrong?
Solution
Wow! That was quick (answering my own question):
myWebView.setBackgroundColor(0);
myWebView.setBackgroundResource(R.drawable.myImage);
That's all I had to do. It works!
Answered By - Eternal Learner
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.