Show html file in alertdilaog builder in Android -
final alertdialog d = new alertdialog.builder(this) .seticon(r.drawable.ic_launcher) .setcancelable(false) // cant cancel pressing key pressing positive button .settitle("about") // can done html style .setpositivebutton(android.r.string.ok, null) .setmessage(html.fromhtml("<i> etc etc stuff")) .create(); d.show();
but have html file in raw folder want display html file formatted , have put required escape sequences etc stuff in html file in raw folder
what want display html file in .setmessage
. getresources().open not working me
how it?
i used use code written above have html file in raw folder want display html file formatted , have put required escape sequences etc stuff in html file in raw folder
you want use webview
:
webview webview = new webview(this); webview.loadurl("file:///android_res/raw/your_file_name.html");
and instead of
.setmessage(html.fromhtml("<i> etc etc stuff"))
use
.setview(webview)
Comments
Post a Comment