I have a strange problem. I have an ArrayAdapter that I am sorting. This displays correctly on my screen, however, when I check the actual data source, the content is not sorted. How can I guarantee that sorting my ListAdapter will also sort my data source?
Collections.sort(quotes, new PercentChangeComparator());
quotesAdapter.sort(new PercentChangeComparator());
Toast toast = Toast.makeText(getApplicationContext(),quotes.get(0).getSymbol(), Toast.LENGTH_SHORT);
toast.show();
For example: If my data source [10,9,1,20]
after sorting my listview will be displayed [1,9,10,20]
but the data source will be [10,9,1,20]
How can i solve this?
source
share