问题
I have the following broadcast receiver:
public class MyRingModeReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Logger.iLog("In my Receiver");
}
}
I then have a service that onCreate does the following:
IntentFilter filter = new IntentFilter();
filter.addAction("android.media.RINGER_MODE_CHANGED");
registerReceiver(new MyRingModeReceiver() , filter);
When I place a call to the emulator and use the volume keys to modify (silence) the ringer nothing happens. Any ideas of what it is that i am doing wrong?
Thanks.
回答1:
Apparently, the Intent Ringer_MODE_CHANGED is not called when you silence a ringer using the phone app ... Only when you modify the ringer outside of a phone call.
来源:https://stackoverflow.com/questions/3284693/how-to-receive-broadcasts-of-ringer-mode-changed-action