title: Change the onClick method of a button programmatically?
body: <p>The button already have a method in xml:</p>
  
  <pre><code>android:onClick="playSound"
  </code></pre>
  
  <p>I created the method in the activity:</p>
  
  <pre><code>public void playSound (View view){ //code1 }
  </code></pre>
  
  <p>I want when I press the button to change <code>onClick</code> to an existing method in activity,</p>
  
  <pre><code>public void pauseSound(View view){ //code2 }
  </code></pre>
  
  <p>and when I press the button again I want <code>onClick</code> to go back to the original method,</p>
  
  <pre><code>public void playSound (View view){ //code1 }
  </code></pre>
  
  <p>Hint: I am using multiple buttons on same method <code>playSound</code></p>