how to copy text to clipboard in android studio

hello guys, this article I am going to show you how to copy text to clipboard in android studio. clipboard framework used to copying and pasting many types of data.

please follow the code given below to copy text to clipboard in android studio.

  • First Create a new project in Android Studio
  • File ⇒ New Android ⇒ Application Project
  • Then Open src -> package -> MainActivity.java and then add following code :

JAVA (MainActivity.java)

  •  Now Open res -> layout -> activity_main.xml and then add following code :

XML (activity_main.xml)

Now run your  project/app to test copy text to the clipboard in android app through android device or any Emulator .

copy text to clipboard in android studio copy text to clipboard in android studio copy text to clipboard in android studio

 

Leave a Reply

Your email address will not be published. Required fields are marked *