Search code examples
androidbroadcastreceiver

Prevent BroadCast in android when state changed by Application


In my system I am monitoring Ringer mode change by implementing BroadCastReceiver. onReceive I changes accordingly in my application.

But when Ringer mode is changed by my application, I don't want to do any thing in OnReceive.

Is there any way to detect this ?

Thanks


Solution

  • One way is you maintain a value in your app saying that this changes has been made by your app and when OnReceive gets called simply compare the value and proceed accordingly.