final AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
// Play sound only if not muted
if( audioManager.getRingerMode() == AudioManager.RINGER_MODE_NORMAL )
{
...
↧