Skip to content

Clipboard - Add documentation about clipboard notifications (toasts) on Android 13+ #3021

@Domik234

Description

@Domik234

Type of issue

Missing information

Description

Starting with Android 13, the system automatically displays a toast notification whenever an app copies text to the clipboard. This behavior may be unexpected for users and developers who rely on programmatic copy operations in a MAUI app.

For consistency, developers may want to display their own custom notifications on Android 12 and lower to indicate clipboard copy actions. According to the official Android documentation:

In Android 12L (API level 32) and lower, we recommend alerting users when they successfully copy by issuing visual, in-app feedback, using a widget like a Toast or a Snackbar, after copying.
To avoid duplicate displays of information, we strongly recommend removing toasts or snackbars shown after an in-app copy for Android 13 and higher.

Currently, the MAUI documentation does not mention this platform-specific behavior. Adding guidance would help developers understand:

  • When automatic notifications occur (Android 13+).
  • How to provide consistent feedback on older Android versions (Android 12 and below).
  • Best practices for user experience when copying data to the clipboard.

This could be included in the Clipboard section of the MAUI docs or in a Platform-specific behaviors section.

Example:

//using section #if ANDROID using Android.OS; using Android.Widget; #endif //method that invokes clipboard ... await Clipboard.Default.SetTextAsync("TestValue"); #if ANDROID if (Build.VERSION.SdkInt < BuildVersionCodes.Tiramisu) // Android 13 { Toast.MakeText(Microsoft.Maui.ApplicationModel.Platform.CurrentActivity, "Copied to clipboard...", ToastLength.Short).Show(); //Replace "Copied to clipboard..." with localized text } #endif ...
Android 10 Image
Android 15 Image

Page URL

https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/data/clipboard?view=net-maui-9.0

Content source URL

https://github.com/dotnet/docs-maui/blob/main/docs/platform-integration/data/clipboard.md

Document Version Independent Id

b48f7f5f-1fdd-46ed-af09-b9a8320d6155

Platform Id

91cfae9a-ac40-ac79-dd4a-3acf44d97551

Article author

@davidortinau

Metadata

  • ID: b48f7f5f-1fdd-46ed-af09-b9a8320d6155
  • PlatformId: 91cfae9a-ac40-ac79-dd4a-3acf44d97551
  • Service: dotnet-mobile
  • Sub-service: dotnet-maui

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions