dynamically register/unregister a broadcast receiver in android

19 views
Skip to first unread message

Siddharth Verma

unread,
Nov 23, 2011, 6:13:36 AM11/23/11
to bpgc-android-community
I want to dynamically register and unregister my receiver class with
the broadcast: "android.net.wifi.STATE_CHANGE" This works very well if
I do this in the manifest. But this makes it static. I want to do it
dynamically in the activity class. What is its correspondent command
in the activity class?

Thanks in advance for your help :)

Alok Sharma

unread,
Nov 23, 2011, 6:33:11 AM11/23/11
to bpgc-androi...@googlegroups.com
i think you just found good answers on your question on stack overflow :)

rachee singh

unread,
Nov 23, 2011, 6:35:16 AM11/23/11
to bpgc-androi...@googlegroups.com
Hey,

Check this out:

http://stackoverflow.com/questions/4805269/programmatically-register-a-broadcast-receiver

The second reply seems to be what you might want to do. Hope it helps,

Rachee
Reply all
Reply to author
Forward
0 new messages