Questions tagged [clipboardmanager]

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

126 questions
4
votes
0 answers

ClipboardManager sometimes does not pick up clipboard content

I have been experiencing some weird behavior. My app randomly fails to detect/pick up clipboard content (other apps do detect and paste it correctly). I am following these guidelines. My code looks like this. public class ClipboardProvider { …
4
votes
1 answer

Copying data giving using getPrimaryClip() giving { text/plain {NULL} }

I am getting { text/plain {NULL} } when I am using ClipData but if I use deprecated method mClipboard.getText() it is working just fine. if (mClipboard.getPrimaryClipDescription().hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)) { ClipData…
mihirjoshi
  • 12,161
  • 7
  • 47
  • 78
4
votes
1 answer

OnPrimaryClipChangedListener called multiple times

In Android, when I copy text from Chrome, Gmail and Inbox my onPrimaryClipChangedlistener method is called 3 times whereas when I copy some text in another app like WhatsApp or Keep this method, as expected, is called just one time. Example: copying…
iroyo
  • 723
  • 7
  • 23
4
votes
1 answer

Android : Implement Broadcast Receiver for ClipboardManager

I want to implement a listener which will listen if some copied any thing from any application. I heard about ClipboardManager.OnPrimaryClipChangedListener() which will listen copy action, but this is not a Receiver (As I understand). I got a…
Android Learner
  • 2,559
  • 6
  • 34
  • 43
3
votes
0 answers

Android: Copy multiple text won't show on clipboard to paste

I have the following pieace of code: ClipboardManager clipboardManager = (ClipboardManager)getContext().getSystemService(Context.CLIPBOARD_SERVICE); ClipDescription clipDescription = new ClipDescription("some_description", new…
Nekomajin42
  • 638
  • 1
  • 6
  • 20
3
votes
1 answer

Val can not be reassigned at ClipboardManager primaryClip

I know this question is already been asked but still, it does not help me to resolve issue I am getting issue while copy data to clipboard-manager below is code fun copyToClipboard(context: Context, text: CharSequence){ var clipboard:…
Siddhpura Amit
  • 14,534
  • 16
  • 91
  • 150
3
votes
2 answers

How to access the clipboard on android device

My initial issue is being able to click a "PASTE" bubble that pops up when the a click is being held on a text field. Currently I have not found a way to get that action to happen using uiautomator script/code. So I started looking at directly…
3
votes
3 answers

is it possible to get clipboard manager via intent-filter and broadcastreceiver?

is it possible to get copied text via intent-filters and broadcast receiver? I want to develop a dictionary application and when user copies text wherever in his phone I want to show the meaning of text. currently I have tried using a Base Activity…
3
votes
1 answer

Samsung devices and Accessibility Services (ACTION_PASTE, Clipboard)

I try to implement auto-login functionality in third party applications. I try to copy and paste username/password in login page. To achieve it I use Android accessibility services. I am able to paste text on different devices. But on Samsung…
3
votes
4 answers

ClipboardManager OnPrimaryClipChangedListener is called twice for every copy

When I copy text to the clipboard onPrimaryClipChanged method is called twice. Any ideas why? @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); final ClipboardManager cliboardManager =…
Todor Kolev
  • 1,432
  • 1
  • 16
  • 33
3
votes
1 answer

Android: looking for effective strategy of copy/paste of complex objects

I'm designing an Android application which works with list of complex objects. An object includes textual or graphical data accompanied by a set of attributes (say, level of importance and last viewed time). I'd like to aid my app with copy and…
mbakulin
  • 181
  • 1
  • 9
3
votes
1 answer

Android Clipboard not Copying Text

I want to test the clipboard on the Android API, so I set out to create a simple application using the Android's ClipboardManager and ClipData classes. I followed the Copy and Paste guide on the Android website, although I had to fill in several…
NioShobu
  • 775
  • 2
  • 10
  • 21
2
votes
2 answers

How to disable Clipboard editor overlay Android Emulator API 33?

How can i disable Clipboard editor overlay, that is enabled by default in Android Emulator API 33?. It is very annoying while debugging apps.It always popup over my debugging apps, and i have to close this every time to do something in my debugging…
Lins Louis
  • 2,393
  • 2
  • 25
  • 30
2
votes
0 answers

How to give clipboard permission to Android Webivew automatically?

When I load a URL in any browser it asks me for the permission provided in the image. But when I try to load this URL in Android Webview how can I ask user to provide this permission? OR How can I automatically paste data into Webview fields within…
Shrikant
  • 1,560
  • 1
  • 15
  • 32
2
votes
1 answer

ClipboardManager throws the following error: Can't create handler inside thread that has not called Looper.prepare() using WorkManager

I'm creating an app where the user has the possibility to copy the text to clipboard for 30 seconds. After 30 seconds the text needs to be removed from clipboard, even if the app has been closed In my main activity I have the following…
1
2
3
8 9