Dagang Wei
Dagang Wei

Reputation: 26498

Android: in-process broadcast

Android broadcast is a good IPC mechanism, but sometimes i only need broadcast or event notification within a process. I want to know if there's something like in-process broadcast?

Upvotes: 1

Views: 140

Answers (2)

Jason Baker
Jason Baker

Reputation: 198597

You may be interested in Otto. It's a publish subscribe library based on Google Guava, and made specifically for Android.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1006849

Use LocalBroadcastManager, found in the Android Support package. Here is a sample application demonstrating its use. Mostly it involves calling methods like registerReceiver() and sendBroadcast() on LocalBroadcastManager.getInstance(this) instead of directly on a Context.

Upvotes: 1

Related Questions