Set the volume buttons to control the music stream while streaming

This commit is contained in:
Cameron Gutman 2014-03-17 03:55:51 -04:00
parent 47a3a959e5
commit f31736ee2d

View File

@ -15,6 +15,7 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.PixelFormat; import android.graphics.PixelFormat;
import android.media.AudioManager;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.os.Bundle; import android.os.Bundle;
import android.view.InputDevice; import android.view.InputDevice;
@ -78,6 +79,9 @@ public class Game extends Activity implements OnGenericMotionListener, OnTouchLi
// We don't want a title bar // We don't want a title bar
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
// Change volume button behavior
setVolumeControlStream(AudioManager.STREAM_MUSIC);
// Inflate the content // Inflate the content
setContentView(R.layout.activity_game); setContentView(R.layout.activity_game);