@ItemLongClick(android.R.id.list) void onListItemLongClick(int position) { final Bookmark bookmark = listAdapter.getItem(position); activityHelper .buildConfirmDialog(new MaterialDialog.ButtonCallback() { @Override public void onPositive(MaterialDialog materialDialog) { try { databaseHelper.deleteBookmark(bookmark); } catch (SQLException e) { activityHelper.showError(e); return; } activityHelper.showToast(getResources().getString(R.string.message_item_removed, bookmark.getTitle())); loadBookmarks(); } }) .title(R.string.action_delete) .content(R.string.message_confirm_delete) .show(); }
@ItemLongClick(R.id.listView) void itemLongClick(RefResourceObject item) { new AlertDialog.Builder(this) .setItems(new String[]{"取消关联"}, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (which == 0) { deleteRef(item); } } }) .show(); }
@ItemLongClick void listViewItemLongClicked(int position) { showPop(null, position - 1); }
@ItemLongClick public void listViewItemLongClicked(int position) { showPop(position); }
@ItemLongClick(R.id.listView) void listViewItemLongClicked(int position) { selectedListItem = position; listView.setItemChecked(position, true); updateSelection(); }