title: How to get notified when user copied something in android?
body: <p>I want to do something when user copied something to clipboard and i know there is an event in the <code>ClipboardManager</code> like this:</p>
  
  <pre><code>class ClipboardListener implements ClipboardManager.OnPrimaryClipChangedListener
  {
     public void onPrimaryClipChanged()
     {
        // use getPrimaryClip() to get the data or simply display a toast
     }
  }
  
  ClipboardManager clipBoard = (ClipboardManager)getSystemService(CLIPBOARD_SERVICE);
  clipBoard.addPrimaryClipChangedListener( new ClipboardListener() );
  </code></pre>
  
  <p>but i want to know how to get notified when my app is closed by user and then user for example copied something from another app to clipboard.
  Should i use <code>Service</code>, If so which one?</p>