如何拆分字符串并在文本视图中设置拆分的字符串?

时间:2021-07-27 08:32:56

标签: java android-studio google-cloud-firestore split textview

enter image description here

String desc=data.getDescription();
String[] sham=desc.split("nextline");
for (String s : sham) {
     Log.e("Description", s);
     longDescription.setText(s);
  }

我尝试过这种方法,但它只设置了文本视图上最后一个拆分的文本。

  • 我正在从 firestore 获取文本。
  • 我也尝试添加 \n 或 \n。

我想在文本视图中设置下一行的所有句子。 有没有办法做到这一点?

LogCat 输出: enter image description here

Android 输出 enter image description here

0 个答案:

没有答案
相关问题