Home > Back-end >  Problems implementing the new sensitive clipboard code in Android SDK 13
Problems implementing the new sensitive clipboard code in Android SDK 13

Time:06-23

Has anyone else tried to mark their clipboard copied data as sensitive as per the following recommendation?

enter image description here

How can I set the sensitivity settings in an android app Java code?

CodePudding user response:

apply() is a Kotlin scope function. You appear to be programming in Java, so the Kotlin syntax will not work for you.

By eyeball, the Java equivalent would be:

PersistableBundle extras = new PersistableBundle();

extras.putBoolean(ClipDescription.EXTRA_IS_SENSITIVE, true);

clipData.getDescription().setExtras(extras);
  • Related