Skip to content

Instantly share code, notes, and snippets.

@aleksanb
Created December 30, 2013 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aleksanb/8176764 to your computer and use it in GitHub Desktop.
Save aleksanb/8176764 to your computer and use it in GitHub Desktop.
Dagens javasuppe
getListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, final int position, long id) {
new AlertDialog.Builder(getActivity()).setTitle("Delete preset?")
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
presets.remove(position);
GhettoORM.getInstance().storePresets(presets);
adapter.notifyDataSetChanged();
}
}).setNegativeButton("No", null)
.show();
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment