How to identify whether the phone is in Silent mode or not?
I am using Android 1.5. I tried by using "android.provider.Settings.ACTION_SOUND_SETTINGS". It is not working.
Use the getRingerMode() method in AudioManager.
getRingerMode()
AudioManager
AudioManager am = (AudioManager)getSystemService(Context.AUDIO_SERVICE); switch (am.getRingerMode()) { case AudioManager.RINGER_MODE_SILENT: Log.i("MyApp","Silent mode"); break; case AudioManager.RINGER_MODE_VIBRATE: Log.i("MyApp","Vibrate mode"); break; case AudioManager.RINGER_MODE_NORMAL: Log.i("MyApp","Normal mode"); break; }
2.1m questions
2.1m answers
60 comments
57.0k users