【发布时间】:2018-03-22 10:46:52
【问题描述】:
当我使用 Collections.sort() 时,它没有真正排序, 这是我的代码:
matchedWords.addAll(getIntent().getStringArrayListExtra("matched_words"));
TextView matchedTexts = findViewById(R.id.textView3);
matchedTexts.setMovementMethod(new ScrollingMovementMethod());
String text = "You have " + matchedWords.size() + " words in NewGsl Library";
matchedTexts.setText(text);
matchedTexts.append("\n");
Collections.sort(matchedWords);
for(String match : matchedWords)
{
matchedTexts.append( match.toLowerCase());
matchedTexts.append("\n");
}
结果是:
1.ıf
2.ıf
3.reading
4.a
5.a
6.about
.
.
.
【问题讨论】:
-
您希望它如何排序?
标签: java android collections