2014年1月20日 星期一

My Sort by Date

int pass;
String hold,hold2;

for (pass = 1; pass <= (combine_st_date.size() - 1); pass++)
for (int i = 0; i <= (combine_st_date.size() - 2); i++) {
try {
if (date_format.parse(combine_st_date.get(i)).after(
date_format.parse(combine_st_date.get(i + 1)))) {

hold = combine_st_date.get(i);
combine_st_date.set(i, combine_st_date.get(i + 1));
combine_st_date.set(i + 1, hold);

hold2 = combine_data.get(i);
combine_data.set(i, combine_data.get(i + 1));
combine_data.set(i + 1, hold2);
}
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

沒有留言:

張貼留言

Related Posts Plugin for WordPress, Blogger...