private void sortDatas() { Collections.sort(mAllprogramdata, new Comparator<PairProgram>() { public int compare(PairProgram arg0, PairProgram arg1) { if (arg0.fav > arg1.fav) { return -1; //一定要返回-1 } else if (arg0.fav == arg1.fav) { return 0; } else { return 1; } } }); }
时间: 2024-10-12 23:10:50