Reputation: 29
final AlertDialog d = new AlertDialog.Builder(this)
.setIcon(R.drawable.ic_launcher)
.setCancelable(false) // Cant Be Cancel By Pressing Back Key Only By Pressing Positive Button
.setTitle("About") // Can Also Be Done By HTML Style
.setPositiveButton(android.R.string.ok, null)
.setMessage(Html.fromHtml("<i> etc etc stuff"))
.create();
d.show();
But I have html file in my raw folder which I want to display html file is properly formatted and I have put all the required escape sequences like etc stuff in html file which is in my raw folder
What I actually want is to display the html file in .setMessage
. Like getResources().open something like this not working for me
How could I do it?
Upvotes: 1
Views: 29
Reputation: 157457
i used to use this code written above but i have html file in my raw folder which i want to display html file is properly formatted and i have put all the required escape sequences like etc stuff in html file which is in my raw folder
you probably want to use a 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)
Upvotes: 2