I’m trying to get my phone’s hard volume keys to control the volume of sounds in my game, which uses SDL 2.0 and SDL_mixer.
Google suggests adding the following in my onCreate method:
setVolumeControlStream(AudioManager.STREAM_MUSIC);
So I did this:
Code:
public class GravityActivity extends SDLActivity {
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setVolumeControlStream(AudioManager.STREAM_MUSIC);
}
}
But the volume buttons still don’t do anything.
Has anyone got this working?
I’m testing on a Motorola Droid Razr running Ice Cream Sandwich.
Thanks,
Philip.