My problem is quite simple, but my code is not working. I want to sort result of a ParseQuery into the ParseQueryAdapter before display it into a ListView.
products.addOnQueryLoadListener(new ParseQueryAdapter.OnQueryLoadListener<Product>() {
@Override
public void onLoaded(List<Product> data, Exception e) {
Collections.sort(data, LastDealComparator);
products.notifyDataSetInvalidated();
}
@Override
public void onLoading() {
}
});
I checked in debugger data is sorted by the Comparator ... but not updated into the ParseQueryAdapter ... notifyDataSetInvalidated do nothing.
For information, initially my problem is to sort a query on a pointer field :
query.orderByDescending("deal.date");
But that's not working too ... so i write a manual sort.