title: How to get listener of a view
body: <p>I write service that interacts with other apps. It registers listeners on views (buttons, textviews,...), that already have listeners. I need to replace them with my own listeners (works), do some stuff and then unregister my listeners and restore the old ones.</p>
  
  <ol>
  <li>An App with a button with an onClickListener is running</li>
  <li>My service registers an onClickListener inside the UI-Thread + do something</li>
  <li>My service restores the old listener</li>
  </ol>
  
  <p>It would be easy, if there was a <code>view.getOnClickListener</code> -method. Then I could save the old ones and replace the new listeners when I'm done.</p>
  
  <p>Is there any way to get listeners from a view or have more that one listener of the same type bound to one view?</p>
  
  <pre><code>Button btn = (Button) findViewById(R.id.btn1);
  btn.setOnClickListener(new OnClickListener() {
  
          public void onClick(View v) {
              //do something
          }
      });
  // I need to do, but found no solution for that.
  View.OnClickListener oldListener = btn.getOnClickListener();
  </code></pre>
  
  <p>If I register the new listeners to a view, the old ones are overridden, right? It would be also okay if both listeners ("new" and "old") exist at the same time. Only the old ones must not be gone.</p>
  
  <p>edit: Unfortunately I have no possibility to save the listener on assignment. I need to get it backwards from the view component.</p>
  
  <p>Thanks</p>