I have a custom object from which I get date and time in the form of a string. Its in a for loop.
List<MyObj> objs = getActivity().getPreferences().getData(activity);
for (MyObj myob : objs) {
int pos = adapter.contains(myob.id);
if (pos == -1) {
data = new MyAdapter.MyData();
data.myob = myob;
adapter.addItem(data);
}
else {
data = adapter.getItem(pos);
data.myob = myob;
}
//Sorting to be done here... I get date from data.myob.date which returns String as 22.05 12:45
//After sorting, I need to notify the adapter.
adapter.notifyDataSetChanged();
}
Now I need to sort out the dates from the custom object in ascending order and descending order both. How can I do that?