title: Android button onClick not working
body: <p>I have avery simple program which uses MediaPLayer. I am new to java and xml and for the life of me can't figue out why the resume button I created won't respond to a click event. It does sit on top of a larger imageButton, which should not repsond in this state, but I think the top level button should regardless, no?</p>
  
  <pre><code>package com.whynoceros.tonguechi;
  
   import android.app.Activity;
  import android.media.MediaPlayer;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.view.animation.Animation;
  import android.view.animation.AnimationUtils;
  import android.view.animation.TranslateAnimation;
  import android.widget.Button;
  import android.widget.ImageButton;
  
  public class ArtistsActivity extends Activity {
  
  Button restart, resume, stop;
  ImageButton play;
  MediaPlayer audio;
  boolean playing;
  boolean paused;
  boolean starting;
  
  public void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.tonguechi);
      audio = MediaPlayer.create(ArtistsActivity.this, R.raw.tongue_chi_mix1);
  
      playing = false;
      paused = false;
      starting = true;
      play = (ImageButton) findViewById(R.id.playbutton);
      stop = (Button) findViewById(R.id.stopbutton);
      resume = (Button) findViewById(R.id.resumebutton);
      restart = (Button) findViewById(R.id.restartbutton);
  
  
  
  }
  /*      play.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
  
              audio.start();
              play.setBackgroundResource(R.drawable.pausebutton2x);
          }
  
      });
     */ 
  
  public void playNow(View view) {
      if(paused){
  
      }
  
      if(playing){
          audio.pause();
          //play.setImageResource(R.drawable.playbutton2x);
          Animation slideA = AnimationUtils.loadAnimation(this, R.anim.stopani);
          stop.startAnimation(slideA);
          Animation slideB = AnimationUtils.loadAnimation(this, R.anim.resumeani);
          resume.startAnimation(slideB);
          Animation slideC = AnimationUtils.loadAnimation(this, R.anim.restartani);
          restart.startAnimation(slideC);
          playing=false;
          paused=true;
      }
      if(starting){
      audio.start();
      play.setImageResource(R.drawable.pausebutton2x);
      playing=true;
      starting=false;
      paused=false;
      Log.i("play","");
  
  
  }
  }
  
  public void resumeNow(View v) {
      audio.start();
      Animation slideD = AnimationUtils.loadAnimation(this, R.anim.stopani);
      stop.startAnimation(slideD);
      Animation slideE = AnimationUtils.loadAnimation(this, R.anim.resumeani_rev);
      resume.startAnimation(slideE);
      Animation slideF = AnimationUtils.loadAnimation(this, R.anim.restartani_rev);
      restart.startAnimation(slideF);
      play.setEnabled(true);
      playing=true;
      paused=false;
      Log.i("resume","");
  
  }
  
  @Override
  protected void onDestroy() {
      super.onDestroy();
      // TODO Auto-generated method stub
          audio.release();
      }
  
  }
  
  
  
  
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="@drawable/playback2x"
  android:orientation="vertical"&gt;
  
  &lt;ImageButton
      android:id="@+id/playbutton"
      android:layout_width="320dp"
      android:layout_height="131dp"
      android:layout_alignParentTop="true"
      android:layout_marginTop="34dp"
      android:scaleType="fitCenter"
      android:background="@android:color/transparent"
      android:src="@drawable/playbutton2x"
      android:contentDescription="button"
      android:onClick="playNow"/&gt;
  
  &lt;Button
      android:id="@+id/resumebutton"
      android:layout_width="75dp"
      android:layout_height="50dp"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true"
      android:text="resume" android:layout_marginTop="-60dp"
      android:onClick="resumeNow"/&gt;
  
  &lt;Button
      android:id="@+id/restartbutton"
      android:layout_width="75dp"
      android:layout_height="50dp"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true"
      android:text="restart" android:layout_marginTop="-60dp"/&gt;
  
  &lt;Button
      android:id="@+id/stopbutton"
      android:layout_width="75dp"
      android:layout_height="50dp"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true"
      android:text="stop" android:layout_marginTop="-60dp"/&gt;
  
  
  
  &lt;ImageView
      android:id="@+id/imageView2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/playbutton"
      android:layout_centerHorizontal="true"
      android:src="@drawable/tips2x" /&gt;
  
  
  &lt;ScrollView
  android:id="@+id/SCROLLER_ID"
  android:layout_width="280dp"
  android:layout_height="240dp"
  android:layout_alignTop="@+id/imageView2"
  android:layout_centerHorizontal="true"
  android:layout_marginTop="53dp"
  android:scrollbars="vertical"
  android:fillViewport="true"&gt;
      &lt;TextView
          android:id="@+id/editText1"
          android:layout_width="280dp"
          android:layout_height="240dp"
          android:layout_alignTop="@+id/imageView2"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="53dp"
          android:inputType="textMultiLine"
          android:text="@string/tips_text"
          android:textColor="#6F372D"
          android:textSize="14dp"
          android:textStyle="normal"
          android:typeface="serif" /&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>