i have two buttons I want to play a sound on click event of both the buttons and also switching focus between them.. here is a issue
<p>i have two buttons (Arrival and Departure) I want to play a sound on click event of both the buttons and also switching requestfocus between them.. here is a issue</p>

<p>for the first time when ever I click either Button Arrival or Departure button its work just fine(Playing sound and focus)
but when I click, for example Arrival after Clicking the departure button its not Playing sound and also no showing the toast.</p>

<p>Here is my code sample</p>

<pre><code>Button btnArrival, btnDeparture, btnScan;
View cameraView;

MediaPlayer mPlayer;

boolean in, out;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    btnArrival = (Button) findViewById(R.id.btnArrival);
    btnDeparture = (Button) findViewById(R.id.btnDeparture);
    btnScan = (Button) findViewById(R.id.btnScan);
    cameraView = findViewById(R.id.cameraView);

    cameraView.setVisibility(View.GONE);

    //cameraLayout.setEnabled(false);
    btnScan.setEnabled(false);

}

public void onArrivalClicked(View v){

    MediaPlayer mPlayer = MediaPlayer.create(MainActivity.this, R.raw.clickbeep);
    mPlayer.start();
    btnScan.setEnabled(true);
    in = true;
    out = false;
    Toast.makeText(MainActivity.this, "Arrival", Toast.LENGTH_SHORT).show();
    focusArrivalBtn();


}

private void focusArrivalBtn() {
    btnArrival.setFocusableInTouchMode(true);
    btnArrival.requestFocus();
}



public void onDepartureClicked(View v){

    MediaPlayer mPlayer = MediaPlayer.create(MainActivity.this, R.raw.clickbeep);
    mPlayer.start();
    btnScan.setEnabled(true);
    in = false;
    out = true;
    Toast.makeText(MainActivity.this, "Departure", Toast.LENGTH_SHORT).show();
    focusDepartureBtn();
}


private void focusDepartureBtn() {
    btnDeparture.setFocusableInTouchMode(true);
    btnDeparture.requestFocus();
}
</code></pre>
