sample for unified-content-api(Android 12 +)
With the existing API, the API to call for each action such as "clipboard, keyboard, drag and drop" to insert content into the app was different.
Since Android 12 added the OnReceiveContentListener interface,
This interface allows you to hook events with content inserted in various actions.
link1
androidx.core:core-ktx:1.5.0-beta03
androidx.appcompat:appcompat:1.3.0-beta01
Currently, there are the following restrictions to use the backward compatible API of androidx.
- Valid only for
AppCompatEditText
. We are considering enabling the content insertion function in other views in the future.
ref
The following external application was used to check the operation.
- Google Chrome
- File Exploler
Insert using Paste from long-press menu |
Insert using drag and drop (image) | Insert using drag and drop (video) | insert a keyboard image |
---|---|---|---|