Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Everyone knows the importance of copy and paste in today’s life. Also in many scenarios you have to copy a particular text , image, link etc. in mobile devices as well. Android provide the copy and paste feature through the library of ClipboardManager and ClipData. You can use this library to copy and paste different types of data on your android devices.
For copy you have to make a instance of ClipboardManager and then put the data to be copied on ClipData object then android will put that data onto system wide Clipboard from where you can access that data anywhere in your device. So firstly lets make a ClipData object and add some random data in it like
Now your dummy text is copied to the clipboard you can add a OnLongClickListener on ant text or image then perform all these oprations inside listener. For image the URI is copied on the clipboard.
Now for pasting this dummy text or any other type of data currently in clipboard you have to again instantiate ClipboardManager and then get the data stored/ copied on the clipboard like
Now you have the copied text in String type variable test you can set it anywhere you want. You can again apply OnLongClickListener on any TextView or EditText and set the copied text over there by this method.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
It was a successful collaboration. The Mobikul team provided the client everything they needed in a timely and high-quality manner. They were very professional, reliable, and accessible during the entire process. The client also saw no room for any improvements in the vendor's performance.
Vincenzo Carrano
Administrator, Segshop
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.