Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. public void onCreate(...) {
  2. ...
  3. SwipeDismissListViewTouchListener.DismissCallbacks dismissCallbacks = new SwipeDismissListViewTouchListener.DismissCallbacks() {
  4. @Override
  5. public boolean canDismiss(int position) {
  6. return true;
  7. }
  8.  
  9. @Override
  10. public void onDismiss(ListView listView, int[] reverseSortedPositions) {
  11. for (int position : reverseSortedPositions)
  12. removeHero(position);
  13.  
  14. // update the list view
  15. list.setAdapter(adapter);
  16. // notify the user by a toast
  17. Toast toast = Toast.makeText(MainActivity.this, "Removed", Toast.LENGTH_SHORT);
  18. toast.show();
  19. }
  20. };
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement