final SwipeToDismissTouchListener<ListViewAdapter> touchListener =
new SwipeToDismissTouchListener<>(
new ListViewAdapter(listView),
new SwipeToDismissTouchListener.DismissCallbacks<ListViewAdapter>() {
@Override
public boolean canDismiss(int position) {
System.err.println("Can dismiss!");
return true;
}
@Override
public void onDismiss(ListViewAdapter view, int position) {
adapter.remove(position);
deleteFavourite(addresses.get(position));
System.err.println("Dismissed!");
}
});
And adding to the fact that the list item is not actually deleted from the database (the deleteFavourite() function is not called, the System.err.println is not called either. The item is removed from the list though so i'm a bit confused!
I call a Log on the method:
And adding to the fact that the list item is not actually deleted from the database (the deleteFavourite() function is not called, the System.err.println is not called either. The item is removed from the list though so i'm a bit confused!