It appears that code that runs locally will not build when I send an Android build on CN1 3.5.2. Can anyone tell me if I'm doing something wrong in my code versus it being an environment issue?
The error message I get when trying to build for Android is "... error: cannot find symbol method compare(int,int)" and another one for the sort method on Vector class.
The implicated line is using the Integer.compare(int,int) method.
Here's the code that uses the Sort method:
protected Vector getLearnableListModel(Vector<String> modulesSelected, Vector<String> categoriesSelected){
Vector result = MyApplication.moduleSet.getLearnableListModel(modulesSelected, categoriesSelected);
result.sort(new Comparator() {
@Override
public int compare(Object o1, Object o2) {
LearnableSpec ls1 = (LearnableSpec) o1;
LearnableSpec ls2 = (LearnableSpec) o2;
return ls1.compareTo(ls2);
}
});
return result;
}
And here's the compareTo method I wrote that is being called above "ls1.compareTo(ls2);" and uses the Integer.compare(int, int) method that produces the other compiler error:
@Override
public int compareTo(LearnableSpec other) {
LinkedHashMap modLHM = MyApplication.moduleSet.getAllModules();
LinkedHashMap catLHM = MyApplication.moduleSet.getAllCategories();
int i = Integer.compare(indexOfLinkedHashMapKey(modLHM, moduleID), indexOfLinkedHashMapKey(modLHM, other.getModuleID()));
if (i != 0) return i;
i = Integer.compare(indexOfLinkedHashMapKey(catLHM,categoryID),indexOfLinkedHashMapKey(catLHM,other.getCategoryID()));
if (i != 0) return i;
return name.compareTo(other.getName());
}