Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onCreate(...) {
- ...
- SwipeDismissListViewTouchListener.DismissCallbacks dismissCallbacks = new SwipeDismissListViewTouchListener.DismissCallbacks() {
- @Override
- public boolean canDismiss(int position) {
- return true;
- }
- @Override
- public void onDismiss(ListView listView, int[] reverseSortedPositions) {
- for (int position : reverseSortedPositions)
- removeHero(position);
- // update the list view
- list.setAdapter(adapter);
- // notify the user by a toast
- Toast toast = Toast.makeText(MainActivity.this, "Removed", Toast.LENGTH_SHORT);
- toast.show();
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement