开发者

android HTML template as resource

开发者 https://www.devze.com 2023-01-04 20:00 出处:网络
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.Howe

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

精彩评论

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