Fix repeat categories bug

This commit is contained in:
misaochan 2016-01-30 16:59:55 +13:00
parent d26cb3d356
commit 8d8002fcf7

View file

@ -98,7 +98,7 @@ public class CategorizationFragment extends SherlockFragment{
protected ArrayList<String> recentCatQuery() { protected ArrayList<String> recentCatQuery() {
ArrayList<String> items = new ArrayList<String>(); ArrayList<String> items = new ArrayList<String>();
ArrayList<String> mergedItems= new ArrayList<String>(); LinkedHashSet<String> mergedItems = new LinkedHashSet<String>();
try { try {
Cursor cursor = client.query( Cursor cursor = client.query(
@ -127,8 +127,10 @@ public class CategorizationFragment extends SherlockFragment{
catch (RemoteException e) { catch (RemoteException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
//Log.d(TAG, "Merged items: " + mergedItems.toString());
return mergedItems; //Needs to be an ArrayList and not a List unless we want to modify a big portion of preexisting code
ArrayList<String> mergedItemsList = new ArrayList<String>(mergedItems);
return mergedItemsList;
} }