Home > Android, Android how to > How to use clipboard on Android

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?

About these ads
Categories: Android, Android how to
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: