How to use clipboard on Android
We moved. Please visit this link for this post.
Clipboard allows to copy data and get data.
At first need to initialize ClipBoardManager:
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
Then you can put data to the clipboard by setText method call
clipboard.setText("Text to copy");
For getting data need to call method getText
String data = clipboard.getText();
Also it is possible to check whether there is any data into clipboard or not
boolean isData = clipboard.hasText();
As you can see, use clipboard in android is very simple.
Is it useful information for you?
Categories: Android, Android how to