Questions tagged [clipboardmanager]

ClipboardManager is an Android service that is responsible for system-wide clipboard management.

126 questions
2
votes
0 answers

the `addPrimaryClipChangedListener()` listener stops listening when the app is killed

On some low-memory devices such as Kindle the app is frequently killed by the task manager (even though it introduces a running service). Apparently the listener (not being an Intent) is unregistered automatically by Android as well and is no longer…
Martin Vysny
  • 3,088
  • 28
  • 39
2
votes
1 answer

How do I prevent my clipboard monitor to copy the clipboard data twice?

I've been working on a simple clipboard monitor that saves the content of the clipboard on a file text when there is a change in the clipboard. Everything works fine but I noticed that whenever I copy something, the text is copied twice in…
Shid
  • 1,336
  • 1
  • 15
  • 18
2
votes
0 answers

KeyEvent paste text from clipboard

I using data collection terminal on Android. Setting data input can be in two variants(as "keyboard" or "clipboard"). I update gradle dependencies of my project (Android studio). Before compile 'com.android.support:appcompat-v7:23.0.0'. After…
2
votes
0 answers

Disable Copy&paste through Clipboard functions in Android by using Xposed

I am currently developing an app(API level 23) that is going to allow the user to choose what application will have the copy and paste functionality enabled. I am working with Xposed to do so. I have 2 files at the moment. MainActivity.java and…
2
votes
0 answers

Android notification setAutoCancel() won't work when using setPrimaryClip() in BroadcastReceiver

I have encountered a strange behavior trying to make a very simple app. I'm firing a notification and when the user clicks on it I copy some random text to the clipboard. Here's how I fire the notification: // Build notification NotificationManager…
Andres
  • 6,080
  • 13
  • 60
  • 110
2
votes
1 answer

ClipData is sometimes Null in Android

I encountered a strange "problem" or maybe a "bug" in Android. I use the ClipboardManager for my App quite often. But if I use it within some seconds twice, I always get a NullPointerException. What I think is that I Clipboard is notalready filled…
Bernd
  • 593
  • 2
  • 8
  • 31
2
votes
2 answers

How to copy text with context to clipboard

I want to know how I can override default text copying mechanism in Android to copy text along with meta data like URL if copying from browser, filename if copying from fine file to clipboard manager? What would be the approach for implementing this…
Abhinav Tyagi
  • 5,158
  • 3
  • 30
  • 60
2
votes
0 answers

Android, Is it possible to copy audio or video to clipboard programically

I am developing simple app to copy text/image/audio/video to clipboard in Android. I can copy text and image to clipboard but is it possible copy audio or video like iOS? Here is the sample of copy image to clipboard. ClipboardManager mClipboard =…
adeltahir
  • 1,087
  • 2
  • 15
  • 31
2
votes
0 answers

How can I format Android clipdata so that when an image is copied to the clipboard, it posts as an image and not just as a uri

So I have been through the posts on stackoverflow and there is no real mention of how to copy actual image data to a clipboard. I can copy the uri to the clipboard like so: ContentValues values = new ContentValues(2); …
HarshMarshmallow
  • 1,007
  • 11
  • 23
2
votes
1 answer

Unnecessary data getting copied to clipboard along with required contents

I have a EditText - ed1. I want to copy the contents of ed1to clipboard, concat it with Hello World and paste it to another EditText - ed2 on the tap of a button. But, I am getting some additional data along with the contents on ed1. final…
user4298677
2
votes
1 answer

Android: Clipboard issue

I am having a very annoying problem. I'm developing an app and now I need to get the text that is in a TextView and pass it to the clipboard. In other words, i need to copy the text. android:textIsSelectable = "true" works on newe versions, but i…
2
votes
1 answer

Clipboard manager not opening for long press event of EditText,WebView

In one of my application i have WebView implemented to load some data from url. Everything is working perfect. But whenever i am trying to long press and select the text of WebView an application gets crashed and throws error as below: Even it…
GrIsHu
  • 29,068
  • 10
  • 64
  • 102
2
votes
0 answers

Clipboard is not getting clear

I have created a android application where i am clearing clipboard in application's onPause method using this code ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); appClipData =…
Indra Yadav
  • 600
  • 5
  • 22
2
votes
0 answers

What is the difference between getIntent/URI/Text in clipboard?

I am trying to understand the simple difference between getIntent(), getURI() and getText() in android, but it is very confusing from layman perspective. Couldn't find a similar question in stackoverflow. A URI is already a text, then how is…
Kesavacharan
  • 318
  • 3
  • 14
2
votes
1 answer

OnPrimaryClipChangedListener not working

This is my code for implementation of OnPrimaryCLipChangedListener: public class PrimaryClipChangedListener implements OnPrimaryClipChangedListener { @Override public void onPrimaryClipChanged() { // TODO Auto-generated method stub //…
Rajath S
  • 169
  • 1
  • 14
1 2
3
8 9