|
for (int i = 0; i < otherApps.getPreferenceCount(); i++) { |
some items in otherApps are not inserted into screen properly due to the nature of looping on a shrinking list with an index loop, instead of a while loop
suggested fix:
while(otherApps.getPreferenceCount() != 0){
Preference p = otherApps.getPreference(0);
otherApps.removePreference(p);
p.setOrder(Preference.DEFAULT_ORDER);
screen.addPreference(p);
}