File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
app/src/main/java/protect/card_locker Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -708,7 +708,13 @@ protected void onResume() {
708708 AlertDialog .Builder builder = new MaterialAlertDialogBuilder (LoyaltyCardViewActivity .this );
709709 builder .setTitle (R .string .cardId );
710710 builder .setView (cardIdView );
711- builder .setPositiveButton (R .string .ok , (dialogInterface , i ) -> dialogInterface .dismiss ());
711+ builder .setPositiveButton (R .string .copy_value , (dialog , which ) -> {
712+ ClipboardManager cm = (ClipboardManager ) getSystemService (CLIPBOARD_SERVICE );
713+ cm .setPrimaryClip (ClipData .newPlainText ("QR value" , loyaltyCard .cardId ));
714+ // Optional app toast; comment out if you rely on Android's privacy toast only
715+ Toast .makeText (this , R .string .copied_to_clipboard , Toast .LENGTH_SHORT ).show ();
716+ });
717+ builder .setNegativeButton (android .R .string .ok , (dialog , which ) -> dialog .dismiss ());
712718 AlertDialog dialog = builder .create ();
713719 dialog .show ();
714720 });
You can’t perform that action at this time.
0 commit comments