Yes you can do both the operation in same button for that do it like below.
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
if (mp.isPlaying()) {
if (mp != null) {
mp.reset();
mp.prepare();
mp.start();
mp.pause();
button1.setText("Play");
}
} else {
if (mp != null) {
mp.start();
button2.setText("Pause");
}
}
}
});
Declare mp as a private MediaPlayer mp = new MediaPlayer(this, R.raw.sound);