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 answers

i 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

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -