Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using LocalBroadcastManager for 'sticky' broadcast

Am I correct in thinking that I cannot send 'sticky' broadcasts using LocalBroadcastManager ? If so this seems very short-sighted particularly if an app uses Fragments that can be swapped in and out during the app lifecycle and relies on broadcast data..

like image 555
D-Dᴙum Avatar asked Jun 04 '12 12:06

D-Dᴙum


1 Answers

Am I correct in thinking that I cannot send 'sticky' broadcasts using LocalBroadcastManager ?

Yes, you are correct.

If so this seems very short-sighted particularly if an app uses Fragments that can be swapped in and out during the app lifecycle and relies on broadcast data..

You are welcome to take the source code to LocalBroadcastManager and create your own sticky extensions to it, if you so desire. Personally, I would use other means of storing such data (model fragments, singletons, or persistent data stores, depending on scenario).

like image 86
CommonsWare Avatar answered Oct 08 '22 16:10

CommonsWare