英文原贴
Q:
I was using
Context.registerReceiver(), Context.sendBroadcast(Intent), and Context.unregisterReceiver()
but when I saw the classLocalBroadcastManager
, it hasregisterReceiver(), sendBroadcast(Intent), and unregisterReceiver()
like inContext
.
I’m confused. When should I use theLocalBroadcastManager
? are they same inContext
?
Regards,
Thanks…
A:
LocalBroadcastManager is as its name says, an implementation of the broadcast methods that are only available to your app. This has some benefits, with the biggest being safety, one less hole to watch out for. In terms of implementation, there are a few things to keep in mind:
- This class is from the Android Support Library
- T