Fix a bug in app removal

This commit is contained in:
Cameron Gutman 2015-02-25 22:27:38 -05:00
parent cc3f2ecb07
commit 7838a787df

View File

@ -398,7 +398,8 @@ public class AppView extends Activity implements AdapterFragmentCallbacks {
}
// Next handle app removals
for (int i = 0; i < appGridAdapter.getCount(); i++) {
int i = 0;
while (i < appGridAdapter.getCount()) {
boolean foundExistingApp = false;
AppObject existingApp = (AppObject) appGridAdapter.getItem(i);
@ -414,7 +415,14 @@ public class AppView extends Activity implements AdapterFragmentCallbacks {
if (!foundExistingApp) {
appGridAdapter.removeApp(existingApp);
updated = true;
// Check this same index again because the item at i+1 is now at i after
// the removal
continue;
}
// Move on to the next item
i++;
}
if (updated) {