i am facing ArrayIndexOutOfBoundsException in sorting. my code is here:
Collections.sort(mutualFriends, new Comparator<FriendInfo>() {
public int compare(FriendInfo s1, FriendInfo s2) {
return s1.name.compareToIgnoreCase(s2.name);
}
});
Logs are here:
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)
and my my mutual friendlist is as:
private List<FriendInfo> mutualFriends = new ArrayList<FriendInfo>();
Any idea to fix this issue. Thanks in advance.