• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps unable to set ringer mode correctly

pablob68

Lurker
Nov 12, 2014
1
0
Hi,
in my app there is a main activity and a broadcast receiver class (on a separate file) on phone_state change. The broadcast receiver is registered in the manifest file and it work fine. I put the phone in silence mode. When the application is in foreground and the phone ring, in a broadcast receiver I set ringermode to normal. The first time the phone ring (silent mode), I see disappear the silent mode symbol correctly but the audio is not available. The next time everything works fine. Can anyone help me?

many thanks!
My broadcast receiver:
public class Myinterceptor extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
AudioManager mode;
mode = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
mode.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
}
}
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones