Stay organized with collections
Save and categorize content based on your preferences.
ClipboardManager.OnPrimaryClipChangedListener
public
static
interface
ClipboardManager.OnPrimaryClipChangedListener
android.content.ClipboardManager.OnPrimaryClipChangedListener
|
Defines a listener callback that is invoked when the primary clip on the clipboard changes.
Objects that want to register a listener call
addPrimaryClipChangedListener()
with an
object that implements OnPrimaryClipChangedListener.
Summary
Public methods
onPrimaryClipChanged
public abstract void onPrimaryClipChanged ()
Callback that is invoked by ClipboardManager
when the primary
clip changes.
This is called when the result of ClipDescription.getClassificationStatus()
changes, as well as when new clip data is set. So in cases where text classification is
performed, this callback may be invoked multiple times for the same clip.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ClipboardManager.OnPrimaryClipChangedListener\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nClipboardManager.OnPrimaryClipChangedListener\n=============================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/content/ClipboardManager.OnPrimaryClipChangedListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nClipboardManager.OnPrimaryClipChangedListener\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------------------------|\n| android.content.ClipboardManager.OnPrimaryClipChangedListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nDefines a listener callback that is invoked when the primary clip on the clipboard changes.\nObjects that want to register a listener call\n[addPrimaryClipChangedListener()](/reference/android/content/ClipboardManager#addPrimaryClipChangedListener(android.content.ClipboardManager.OnPrimaryClipChangedListener)) with an\nobject that implements OnPrimaryClipChangedListener.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onPrimaryClipChanged](/reference/android/content/ClipboardManager.OnPrimaryClipChangedListener#onPrimaryClipChanged())`() ` Callback that is invoked by [ClipboardManager](/reference/android/content/ClipboardManager) when the primary clip changes. |\n\nPublic methods\n--------------\n\n### onPrimaryClipChanged\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onPrimaryClipChanged ()\n```\n\nCallback that is invoked by [ClipboardManager](/reference/android/content/ClipboardManager) when the primary\nclip changes.\n\nThis is called when the result of [ClipDescription.getClassificationStatus()](/reference/android/content/ClipDescription#getClassificationStatus())\nchanges, as well as when new clip data is set. So in cases where text classification is\nperformed, this callback may be invoked multiple times for the same clip.\n\n\u003cbr /\u003e"]]