Kimossab

[Android] - ListView Long Click Example

Jun 14th, 2015
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. listView.setLongClickable(true);
  2. listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener()
  3. {
  4. public boolean onItemLongClick(AdapterView parent, View view, int position, long id)
  5. {
  6. Vibrator v = (Vibrator) getApplicationContext().getSystemService(Context.VIBRATOR_SERVICE);
  7. v.vibrate(50);
  8. GBD.Remover(intl.get(position));
  9. Toast.makeText(getApplicationContext(), "Tarefa com ID " + intl.get(position) + " Removida.", Toast.LENGTH_LONG).show();
  10. AtulizarListView();
  11. return true;
  12. }
  13. });
Advertisement
Add Comment
Please, Sign In to add comment