Manjari Manjari - 1 year ago 70
Java Question

Replace intents for notification within app

Intents are taking too long to be process in my app. Is there a better way I can tell different elements of my app that something has happened? For example I use:

Intent i = new Intent("com.ftx.player_died");

I listen for that intent on two different places in my app. I would not like to make the same call twice.


Doesn't scale nicely.

Is there something I can use that is faster than intents but that I don't make same call twice or three times?

Answer Source

Using LocalBroadcastManager orEventBus is not only faster the normal BroadcastManager, but also is private to your app (that means other application cant listen to your Intent action)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download