Merge pull request #54 from misaochan/repeatcats-fix

Fix repeat categories bug
This commit is contained in:
Nicolas Raoul 2016-01-31 15:32:44 +09:00
commit 29cd67f500

View file

@ -98,7 +98,7 @@ public class CategorizationFragment extends SherlockFragment{
protected ArrayList<String> recentCatQuery() {
ArrayList<String> items = new ArrayList<String>();
ArrayList<String> mergedItems= new ArrayList<String>();
Set<String> mergedItems = new LinkedHashSet<String>();
try {
Cursor cursor = client.query(
@ -127,8 +127,10 @@ public class CategorizationFragment extends SherlockFragment{
catch (RemoteException 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;
}