Setting Url to a WebView

Viewed 39832

I am trying to set an image to a WebView for my app.

I am using the below code to set the image to my WebView,

  String imageUrl =  " file:///android_res/drawable/dinner_menu.png";
    WebView wv = (WebView) findViewById(R.id.yourwebview);
    wv.getSettings().setBuiltInZoomControls(true);
   wv.loadUrl(imageUrl);

This works fine for Android 2.2 and higher.

But if I try to run the code in 2.1 or lower, it shows an error as,

The requested file was not found /android_res/drawable/dinner_menu.png.

Can anyone help me out.

1 Answers
Related