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;
}
From above code only detect only one mode. but i want to check 2 mode either ring+vibrate or silent+vibrate.
How it is possible?
There is no any method to get ring+vibrate and silent+vibrate. As we know that we have three method to get ringer mode.
So , You just have to create a method to check condition for both ring and vibrate
Like ring+vibrate.