如何在android中保留字符串数组项中的文本换行?

如何在android中保留字符串数组项中的文本换行?,android,arrays,string,Android,Arrays,String,我正在开发一款长文本的android应用程序。 我把它们放在一个字符串数组中 孟加拉国被恰当地描述为一个古老土地上的新国家。 关于孟加拉国过去的辉煌已经有很多记载,尤其是在老记录中,比如普林尼和埃利瑟伦海周边地区(公元一世纪)的证据。 他们包括来自非洲的中国旅行者法亨(公元四世纪)、顺安宗(公元七世纪)、马勋和费信(公元十五世纪)、伊本·巴图塔(公元十四世纪)、来自威尼斯的尼古拉·坎蒂(公元十五世纪)和弗雷德里克·凯撒(公元十六世纪)、十六世纪的意大利人维切马(Verthema),葡萄牙的巴

我正在开发一款长文本的android应用程序。 我把它们放在一个字符串数组中


孟加拉国被恰当地描述为一个古老土地上的新国家。
关于孟加拉国过去的辉煌已经有很多记载,尤其是在老记录中,比如普林尼和埃利瑟伦海周边地区(公元一世纪)的证据。
他们包括来自非洲的中国旅行者法亨(公元四世纪)、顺安宗(公元七世纪)、马勋和费信(公元十五世纪)、伊本·巴图塔(公元十四世纪)、来自威尼斯的尼古拉·坎蒂(公元十五世纪)和弗雷德里克·凯撒(公元十六世纪)、十六世纪的意大利人维切马(Verthema),葡萄牙的巴博萨和塞巴斯丁·曼里克(16世纪),法国的特拉维尼埃和伯尼埃(17世纪),以及伊丽莎白女王一世的大使拉尔夫·费什。
从词源学上讲,孟加拉一词源自同源词Vanga,该词最早出现在公元前500年至公元500年之间的印度教经文Aitarey Aranyaka中。

为此,您可以将html文本放在strings.xml文件中,方法如下:

 <string name="text">
    <![CDATA[
        </br>Bangladesh has been aptly described as a new state in an ancient land.</br></br>

        Much has been written about the past glory of Bangladesh, notably in old records like the evidence of Pliny and Periplus of the Erythrean Sea (first century AD).</br></br>

        They include the Chinese travellers Fa-hien (fourth century AD), Hue-an-tsung (seventh century), Ma-hoen and Fei-shin (fifteenth century), Ibne Batuta (fourteenth century) from Africa, Nicola Kanti (fifteenth century) and Ceasar the Frederik (sixteenth century) from Venice, Verthema, an Italian in the sixteenth century, Barbosa and Sebastin Manric (sixteenth century) from Portugal, Travernier and Bernier from France (seventeenth century) and Queen Elizabeth-the First\'ambassador Ralf Fish.</br></br>

        Etymologically, the word Bangladesh is derived from the cognate Vanga which was first mentioned in Aitarey Aranyaka, a Hindu scripture composed between 500 BC and 500 AD.

    ]]>
 </string>
TextView textView = (TextView)findViewById(R.id.textview);
textView.setText(Html.fromHtml(getString(R.string.html)));

根据您所需的格式添加分隔符和段落标记。实际上,我可以通过手动添加\n和\t来做到这一点。我的问题是:由于我的数据集很大,是否有任何方法可以通过编程/其他方式保留格式,而无需手动添加任何内容(
)?