How to use/locate LocalBroadcastManager
as described in google docs and Service broadcast doc?
I tried to google it, but there is no code available to start with?
The documents say that I should use it if I want to do broadcast internally with in my app's process but I don't know where to look for this.
Any help/comment?
Update: I know how to use Broadcasts but don't know how to get LocalBroadcastManager
available in my project.
On Receiving end:
Then handle incoming intent data in onReceive.
On Sending End:
I'd rather like to answer comprehensively.
LocalbroadcastManager included in android 3.0 and above so you have to use support library v4 for early releases. see instructions here
Create a broadcast receiver:
Register your receiver in onResume of activity like:
unRegister receiver in onPause:
Now whenever a localbroadcast is sent from applications' activity or service, onReceive of onNotice will be called :).
Edit: You can read complete tutorial here LocalBroadcastManager: Intra application message passing