0

I have 2 activities : 1. BroadCastReceiver 2. Settings. I am writing a condition in Settings activity that upon being satisfied, should disable the BroadCastReceiver class or the BroadCastReceiver class should not run until I reverse the condition in Settings Activity. However the problem is that BroadCastReceiver class is called through the Manifest file where I have given it a persmission :

android:name="android.provider.Telephony.SMS_RECEIVED"

Now, I am not able to figure out how to disable the BroadCastReceiver class via Setting activity ?

TechFrk
  • 185
  • 2
  • 2
  • 15

1 Answers1

0

Don't configure the BroadcastReceiver in the Manifest file. Instead register and unregister it programmatically.

Check out this discussion.

Community
  • 1
  • 1
David C Adams
  • 1,953
  • 12
  • 12