如何将粘贴从Ms word复制到TextView,同时保持相同的格式基本上是颜色和粗体

时间:2014-09-16 13:29:34

标签: java android html

我有一个Word文本(约30页),带有标题和标题颜色和粗体,我需要将5个部分(活动)的粘贴复制为TextView,我通常使用以下代码:(text1是字符串变量, t1是textview)

text1 = "<font color=#000080><b>"
                + "Internal Audit"
                + "</b></font>"
    +<br><font color=#000080><b>Definition of Internal Audit</b></font></br>";

+"<br>Internal auditing is an independent, objective assurance and consulting activity designed to add value and improve an organization\'s operations. It helps an organization accomplish its objectives by bringing a systematic, disciplined approach to evaluate and improve the effectiveness of risk management, control, and governance processes.</br>" +"<br></br>";

   t1.setText(Html.fromHtml(text1));

但是现在在这种情况下我有很多文本要用简化的html格式化,我的问题是:有没有更好更快的方法来复制过去带有颜色和粗体的文字文本到textview,我需要的只是保持不变颜色和粗体不需要相同的字体或其他格式。 请帮忙!

0 个答案:

没有答案