Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt 6 for Android. Do not show "sharing" menu when copying from memory to clipboard with QClipboard. How?
Qt 6.11 is out! See what's new in the release blog

Qt 6 for Android. Do not show "sharing" menu when copying from memory to clipboard with QClipboard. How?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 167 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bogong
    wrote last edited by
    #1

    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?

    1 Reply Last reply
    0
    • Nils SjobergN Offline
      Nils SjobergN Offline
      Nils Sjoberg
      wrote last edited by
      #2

      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.

      1. Using QAndroidJniObject / QJniObject

      "What's up, Doc?"

      B 1 Reply Last reply
      1
      • Nils SjobergN Nils Sjoberg

        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.

        1. Using QAndroidJniObject / QJniObject
        B Offline
        B Offline
        bogong
        wrote last edited by
        #3

        @Nils-Sjoberg Thx a lot. Will try it today.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved