Qt 6 for Android. Do not show "sharing" menu when copying from memory to clipboard with QClipboard. How?
-
Hello all!
Trying to get rid of Android "sharing" menu when copying from memory to clipboard with QClipboard->setText("SomeText"). When copying text to clipboard Android showing "sharing" menu automatically. Is there any way to prohibit showing "sharing" menu?
-
Android allows you to mark ClipData as sensitive (e.g. passwords), then the system does not show previews/suggestions for it
Do this only through native Java/Kotlin code, not through QClipboard
Build the ClipData yourself via JNI and add to it:PersistableBundle extras = new PersistableBundle(); extras.putBoolean(ClipDescription.EXTRA_IS_SENSITIVE, true); clipData.getDescription().setExtras(extras);This is only available starting from API 33.
- Using QAndroidJniObject / QJniObject
-
Android allows you to mark ClipData as sensitive (e.g. passwords), then the system does not show previews/suggestions for it
Do this only through native Java/Kotlin code, not through QClipboard
Build the ClipData yourself via JNI and add to it:PersistableBundle extras = new PersistableBundle(); extras.putBoolean(ClipDescription.EXTRA_IS_SENSITIVE, true); clipData.getDescription().setExtras(extras);This is only available starting from API 33.
- Using QAndroidJniObject / QJniObject
@Nils-Sjoberg Thx a lot. Will try it today.