Alex Rivera | Logout

Setting webview background image to a resource graphic in Android

Asked 2009-08-11T13:36:47.440
30

I'm trying to set the background of a webview to a drawable image resource in Android.

From the sdk it seems something like this would work but it doesn't.

WebView web = (WebView) findViewById(R.id.webView);

web.setBackgroundResource(R.drawable.backgroundmain);
web.loadData(profile, "text/html", "UTF-8");

Any idea's?

Edit
Report

1 Answer

3

If not working on Android 3.1, try fix the AndroidManifest.xml:

android:hardwareAccelerated="false"
answered 2011-09-05T09:42:28.100

Your Answer