how can I detect whether the android phone in Silent mode programmatically -


how identify whether phone in silent mode or not?

i using android 1.5. tried using "android.provider.settings.action_sound_settings". not working.

use getringermode() method in audiomanager.

audiomanager = (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; } 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -