Avoid duplicate cliboard copy notification on 13+

Since Android 13, Android itself will show a notification
when copying data to the clipboard
This commit is contained in:
emanuele-f 2024-04-11 10:55:05 +02:00
parent 78f67e75e5
commit 16ccc20750

View File

@ -917,7 +917,9 @@ public class Utils {
ClipData clip = ClipData.newPlainText(ctx.getString(R.string.stats), contents);
clipboard.setPrimaryClip(clip);
Utils.showToast(ctx, R.string.copied);
// Only show a toast for Android 12 and lower
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2)
Utils.showToast(ctx, R.string.copied);
} catch (Exception e) {
Log.e(TAG, "copyToClipboard failed: " + e.getMessage());
Utils.showToastLong(ctx, R.string.error);