0

I have an android application in which I have some images. after encryption the image is not displayed in the mobile phone but it works well in emulator. My images are in drawable folder. In emulator it worke but when I installed the apk on mobile it don't work. can anyone tell me the answer.

Thanks

wv.getSettings().setBuiltInZoomControls(true);
    if (check_lang.equals("Marathi")) {
        getstr = getResources().getResourceEntryName(
                Marathi_Arati_ID_Array[imageIds[currentIndex]]);
        String data = "<body><center>" + "<img align="+"middle"+" src=\"" + getstr + ".png"
                + "\"/></center></body>";
        wv.loadDataWithBaseURL("file:///android_res/drawable/", data,
                "text/html", "utf-8", null);
    } else if (check_lang.equals("Hindi")) {
        getstr = getResources().getResourceEntryName(
                Hindi_Arati_ID_Array[imageIds[currentIndex]]);
    String data = "<center><body>" + "<img align="+"middle"+" src=\"" + getstr + ".jpg"
                + "\"/></body></center>";
        wv.loadDataWithBaseURL("file:///android_res/drawable/", data,
                "text/html", "utf-8", null);

    }
Doctor Who
  • 747
  • 1
  • 5
  • 28

2 Answers2

0

Try this webview.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);

Reinherd
  • 5,476
  • 7
  • 51
  • 88
0

Your Base Url is off.

try this one and copy the image you want to use to the assets folder.

wv.loadDataWithBaseURL("file:///android_asset/", data, "text/html", "utf-8", null);

And reference it as AndroidLeamer suggested

Daniel Bo
  • 2,518
  • 1
  • 18
  • 29