title: on click buttons not working in android studio
body: <p>for an app that I am creating, it doesn't allow me to specify what to do with the button and is giving me errors instead. The app helps switch between three music songs.</p>
  
  <p>the code is down</p>
  
  <pre><code>    package com.example.atvan.babysleeper;
  
  import android.media.MediaPlayer;
  import android.os.Handler;
  import android.os.Message;
  import android.provider.MediaStore;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.SeekBar;
  import android.widget.TextView;
  
  import com.example.atvan.babysleep.R;
  
  public class MainActivity extends AppCompatActivity {
  
      Button playBtn;
      Button one;
      Button two;
      Button three;
      SeekBar positionBar;
      SeekBar volumeBar;
      TextView elapsedTimeLabel;
      TextView remainingTimelabel;
      MediaPlayer mp;
      int totalTime;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          playBtn = (Button) findViewById(R.id.playBtn);
          elapsedTimeLabel = (TextView) findViewById(R.id.elapsedTimeLabel);
          remainingTimelabel = (TextView) findViewById(R.id.remainingTimeLabel);
          one = (Button) findViewById(R.id.one);
          two = (Button) findViewById(R.id.two);
          three = (Button) findViewById(R.id.three);
  
  
          //Media player
  
          public void setOne(View view){
              mp = MediaPlayer.create(this, R.raw.music3);
          }
          public void setTwo(View view){
              mp = MediaPlayer.create(this, R.raw.music2);
          }
          public void setThree(View view){
              mp = MediaPlayer.create(this, R.raw.music1);
  
          }
  
  
          mp.setLooping(true);
          mp.seekTo(0);
          mp.setVolume(0.5f,0.5f);
          totalTime = mp.getDuration();
  
          //position Bar
          positionBar = (SeekBar) findViewById(R.id.positionBar);
          positionBar.setMax(totalTime);
          positionBar.setOnSeekBarChangeListener(
                  new SeekBar.OnSeekBarChangeListener() {
                      @Override
                      public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                          if (fromUser) {
                              mp.seekTo(progress);
                              positionBar.setProgress(progress);
                          }
                      }
  
                      @Override
                      public void onStartTrackingTouch(SeekBar seekBar) {
  
                      }
  
                      @Override
                      public void onStopTrackingTouch(SeekBar seekBar) {
  
                      }
                  }
          );
  
          //Volume Bar
          volumeBar = (SeekBar) findViewById(R.id.volumeBar);
          volumeBar.setOnSeekBarChangeListener(
                  new SeekBar.OnSeekBarChangeListener() {
                      @Override
                      public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                          float volumeNum = progress/100f;
                          mp.setVolume(volumeNum, volumeNum);
                      }
  
                      @Override
                      public void onStartTrackingTouch(SeekBar seekBar) {
  
                      }
  
                      @Override
                      public void onStopTrackingTouch(SeekBar seekBar) {
  
                      }
                  }
          );
  
          //thread (update positionBar amd timeLabel)
          new Thread(new Runnable() {
              @Override
              public void run() {
                  while (mp != null) {
                      try{
                          Message msg = new Message();
                          msg.what = mp.getCurrentPosition();
                          handler.sendMessage(msg);
                          Thread.sleep(1000);
                      }catch (InterruptedException e){}
                  }
              }
          }).start();
  
  
  
      }
  
      private Handler handler;
  
      {
          handler = new Handler(new Handler.Callback() {
              @Override
              public boolean handleMessage(Message msg) {
                  int currentPosition = msg.what;
                  // Update positionBar.
                  positionBar.setProgress(currentPosition);
  
                  // Update Labels.
                  String elapsedTime = createTimeLabel(currentPosition);
                  elapsedTimeLabel.setText(elapsedTime);
  
                  String remainingTime = "- " + createTimeLabel(totalTime - currentPosition);
                  remainingTimelabel.setText(remainingTime);
  
                  return true;
              }
          });
      }
  
      public String createTimeLabel(int time) {
          String timeLabel = "";
          int min = time / 1000 / 60;
          int sec = time /1000 % 60;
  
          timeLabel = min + ":";
          if (sec&lt;10) timeLabel += "0";
          timeLabel += sec;
  
          return timeLabel;
      }
  
      public void playBtnClick(View view) {
          if (!mp.isPlaying()){
              //stopping
              mp.start();
              playBtn.setBackgroundResource(R.drawable.stop);
          } else {
              //playing
              mp.pause();
              playBtn.setBackgroundResource(R.drawable.play);
  
          }
      }
  </code></pre>
  
  <p>the error it gives is that I have an illegal start of expression in my media player section. it also indicates to give ; somewhere there. when placed at the end of the code . it does not give any errors but the app doesn't run </p>
  
  <p>the error is here</p>
  
  <p><a href="https://i.stack.imgur.com/enWl5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/enWl5.png" alt="the error"></a></p>
  
  <p><a href="https://i.stack.imgur.com/UyMKn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UyMKn.png" alt="enter image description here"></a></p>