Repository navigation
[Android] Respect custom system-wide text selection toolbar buttons #139361
Description
Edit
This feature is implemented. It is directly available in newly created Flutter project since Flutter 3.19.
For older project, the following section should be added to the Android manifest file:<!-- Required to query activities that can process text, see: https://developer.android.com/training/package-visibility and https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT. In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. --> <queries> <intent> <action android:name="android.intent.action.PROCESS_TEXT"/> <data android:mimeType="text/plain"/> </intent> </queries>
Use case
On Android, it's possible to write an app that adds a custom button to the system-wide text selection toolbar. For example, here the Android app AnkiDroid has added the "Anki Card" button to my text selection toolbar, and it appears in any app, such as the Google app here.
Proposal
Flutter should respect these added buttons, so that in any Flutter app running on Android, the buttons that the user has added to their device show up in the default text selection toolbar just like in any native app.
This is the Android part of #107603 which is broad (all plaforms).
Creating this issue to make it easier to follow.
Implementation steps
| # | Status | Description | Related Work |
|---|---|---|---|
| 1 | Done | Engine - Add Android support for querying and invoking text processing actions. | flutter-team-archive/engine#44579 |
| 2 | Done | Framework - Add ProcessTextService to intereact with the engine | #137145 |
| 3 | Done | fluttter_tools - Add queries section to Android manifest file | #137207 |
| 4 | Done | Framework - Add queried text processing actions to the text selection toolbar for EditableText |
#139738 |
| 5 | Done | Framework - Add queried text processing actions to the text selection toolbar for SelectionRegion |
#141103 |
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone (PR merged)

Activity
19 remaining items
piedcipher commentedon Aug 6, 2024
I'm removing the fixed label as issue is still open.
bleroux commentedon Aug 7, 2024
Closing this issue as it is fixed since Flutter 3.19.
For Flutter projects created since Flutter 3.19, the feature is automatically available.
For projects created before Flutter 3.19, a section should be added to the Android manifest. I edited the issue description accordingly and I will open another issue to track the following question: "Do we have a way to change the Android manifest file for existing Flutter apps like this (see last comment)?"
Edit: filed #152991
github-actions commentedon Aug 21, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.Add custom system-wide text selection toolbar buttons on Android (#13…