开发者

android HTML template as resource

is there any way to have an html file (i.e. an html template) be a resource in android? I'd like to reference it in a sim开发者_JAVA百科ilar way that i store strings in the res/values/strings.xml. However, when i do this, it appears the HTML is not getting rendered correctly when i use myTextView.setText(Html.fromHtml(MessageFormat .format(getResources().getString(R.string.myHtmlFile), ...)


You can place raw HTML or other format files in /res/raw or /assets directory of your project. You can access the first with this method, and the second with this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜