android - passing value from Service to many Activities -


i need pass value service many activities, of them haven't been initialized, want these value in initialization. know broadcast can useful way, it's relatively slow. there way can achieve goal? thank you!

one option use greenrobot's eventbus, using sticky events feature. have activities register bus in onstart() , unregister in onstop(). have service post events on bus needed poststicky(). activities events:

  • when posted

  • when register on bus, if sticky event posted before created — last such event


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -