Commit ffd1b318 authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

Stop audio audio player if returning home

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent cb9827d6
......@@ -4,6 +4,7 @@ import android.app.Activity;
import android.graphics.Bitmap;
import android.media.AudioManager;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
......@@ -176,6 +177,14 @@ public class AudioPlayerActivity extends Activity implements AudioPlayer {
mAudioController.shuffle();
update();
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
/* Stop the controller if we are going home */
if(keyCode == KeyEvent.KEYCODE_HOME) {
mAudioController.stop();
}
return super.onKeyDown(keyCode, event);
}
@Override
protected void onPause() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment