Question

I want to restrict the procedure cut/copy inside the application and paste outside the application. However i must be able to cut/copy and paste with in my application. How do i implement this?

The problem i am facing is once i come out of the application i try to paste it doesn't paste anything but if i open clip board then i can see all the items i have stored in my clip board from my application.

Was it helpful?

Solution

How do i implement this?

You don't use the clipboard. The clipboard is a device-wide system service. Anything you put there will be available to other applications.

You are welcome to create your own "clipboard" construct inside your app and attempt to use it. This will not be completely reliable, insofar as you will be unable to control the behavior of EditText and the system clipboard on all devices, but that may or may not be your particular area of concern.

OTHER TIPS

Well i think this should work.

use ClipboardManager class

if it

hasText() 

see if using clipdata.newPlainText method to add empty string to the clipboard in your onPause() method can solve it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top