code to display image(exists in sdcard) in Webview as follows,in Android

final String URI_PREFIX = "file:///sdcard/images.jpg";
        WebView web = (WebView) findViewById(R.id.webView1);
        String html = new String();
        html = ("<html><body><header><h1>Title</h1></header><section><img src=\""+URI_PREFIX+"\" align=left><p>Content</p></section></body></html>" );

        web.loadDataWithBaseURL(URI_PREFIX,
        html,
        "text/html",
        "utf-8",
        "");

Comments

Popular posts from this blog

Custom Dialog with no title and full screen in Android

code to display .pdf,.text,.DOC,.DOCX,.doc extension files exists in SDCard

Best working code to set Date limits on Date Picker Dialog,in Android