Android Clipboard: Copy&Paste

I know it’s pretty straightforward but I haven’t found any example out there of using the clipboard from Android Applications. So for beginners like me, here is an example of how to copy and paste some text using ClipboardManager object.

This is the Copy button code:

// Copy EditCopy text to the ClipBoard
private void copyToClipBoard()
ClipboardManager ClipMan = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);

and the Paste button source:

// Paste ClipBoard Text to EditPaste
private void pasteFromClipBoard()
ClipboardManager ClipMan = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);

Simple, right? 😉 By the way, editPaste and editCopy are both EditText class objects. In case you need it, the whole project can be downloaded from my GitHub repository.



5 Responses to “Android Clipboard: Copy&Paste”

  1. 1 shamtest May 14, 2011 at 9:44 am

    I can’t seem to look at this post from my iphone!

  2. 2 Shubham June 4, 2011 at 6:02 am


    thanks for sharing your knowledge.
    Do u have any idea how can we use this Clipboard functionality for Images.


  3. 3 Shubham June 10, 2011 at 12:47 pm

    pls reply

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

Who’s in charge here?

Follow me on Quoders Blog…

Quoders Twitter



%d bloggers like this: