public static void deleteMultiple(Context context, Runnable action) { boolean needConfirm = PreferenceManager.getDefaultSharedPreferences(context) .getBoolean("pref_gallery_confirm_delete_key", true); if (!needConfirm) { if (action != null) action.run(); } else { String title = context.getString(R.string.confirm_delete_title); String message = context.getString(R.string.confirm_delete_multiple_message); confirmAction(context, title, message, action); } }
static void deleteImpl(Activity activity, Runnable onDelete, boolean isImage) { boolean needConfirm = PreferenceManager.getDefaultSharedPreferences(activity) .getBoolean("pref_gallery_confirm_delete_key", true); if (!needConfirm) { if (onDelete != null) onDelete.run(); } else { String title = activity.getString(R.string.confirm_delete_title); String message = activity.getString( isImage ? R.string.confirm_delete_message : R.string.confirm_delete_video_message); confirmAction(activity, title, message, onDelete); } }