android - Using WebView Like this would work? -
android - Using WebView Like this would work? -
this question has reply here:
@android display /res/viewable in webview 7 answersi using drawables in src tag in webview work?
mwebview.loaddatawithbaseurl("","<table width=\"100%\"><tr><td style=\"text- align:center; background-color:grey;\"><img src=\""+r.id.button+"\"/></td></tr> </table>"+question, "text/html", "utf-8", "");
i using drawables in src tag in webview work?
absolutely not. html expects urls images. not mention specifying widget id, not drawable resource.
sir helped working correctly on emulator not on device .do know how solve it?
perhaps device older -- 1 reply on question mr. clayson linked suggests file:///android_res/
urls work on android 2.2 , higher.
however, android.resource
scheme has been around longer:
android.resource://[package]/[res type]/[res name]
e.g.:
android.resource://this.is.my.package/drawable/button
i have not tried in webview
, worth shot.
android android-webview
Comments
Post a Comment