private void deleteGesture(NamedGesture gesture) { sStore.removeGesture(gesture.name, gesture.gesture); sStore.save(); final GesturesAdapter adapter = mAdapter; adapter.setNotifyOnChange(false); adapter.remove(gesture); adapter.sort(mSorter); checkForEmpty(); adapter.notifyDataSetChanged(); Toast.makeText(this, R.string.gestures_delete_success, Toast.LENGTH_SHORT).show(); }
@Override protected void onProgressUpdate(NamedGesture... values) { super.onProgressUpdate(values); final GesturesAdapter adapter = mAdapter; adapter.setNotifyOnChange(false); for (NamedGesture gesture : values) { adapter.add(gesture); } adapter.sort(mSorter); adapter.notifyDataSetChanged(); }