Thursday, July 5, 2012

Android mute and unmute sound

Android mute and unmute sound  
Below i write the code set device sound mute and unmute.
Problem.
For Ex: you are developing game application . if you want set game sound mute and unmute or anything else.
Solution.
Sound UnMute :
/**
* @author vijayakumar
*/

AudioManager audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE); audio.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
Sound Mute:
/**
* @author vijayakumar
*/

AudioManager audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE); audio.setRingerMode(AudioManager.RINGER_MODE_SILENT);

No comments:

Post a Comment

Check out this may be help you

Related Posts Plugin for WordPress, Blogger...