我在排序中面临 ArrayIndexOutOfBoundsException 。我的代码在这里:
Collections.sort(mutualFriends, new Comparator<FriendInfo>() {
public int compare(FriendInfo s1, FriendInfo s2) {
return s1.name.compareToIgnoreCase(s2.name);
}
});
日志在这里:
STACK_TRACE=java.lang.ArrayIndexOutOfBoundsException
at java.util.Collections.sort(Collections.java:1970)
at com.platinumapps.fragments.Mutual_Friends_Fragment$1.onComplete(Mutual_Friends_Fragment.java:138)
at com.platinumapps.facedroid.AsyncRequestListener.onComplete(AsyncRequestListener.java:59)
at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:328)
我的共同好友列表如下:
private List<FriendInfo> mutualFriends = new ArrayList<FriendInfo>();
任何想法来解决这个问题。提前致谢。