Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教 #1

Closed
qzqs opened this issue May 24, 2018 · 1 comment
Closed

请教 #1

qzqs opened this issue May 24, 2018 · 1 comment

Comments

@qzqs
Copy link

qzqs commented May 24, 2018

private void sortData() {
final Collator collator = Collator.getInstance();
Collections.sort(adapter.getData(), new Comparator() {
@OverRide
public int compare(Word o1, Word o2) {
return collator.compare(o1.getName(), o2.getName());
}
});
}

作者这一步是排序么?具体有什么作用?

@li-yu
Copy link
Owner

li-yu commented May 24, 2018

因为 App 提供了一个新增单词的功能,希望新单词插入在合适的位置,所有进行了重新排序。

@li-yu li-yu closed this as completed Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants