Android Publish / Subscribe Template

Is there a publish / subscribe template in android?

What I want to achieve, I have this class that can notify an interested participant about an event. Then the interested party can do whatever it needs.

From the world of .net microsoft, such things are built-in.

Does Android have something similar, or do I need to write something like an observer pattern?

+5
source share
5 answers

I think you are speaking in terms of passing events / messages between classes in your application. Therefore, this question probably comes down to the Java implementation of such a template.

(.. event ), / - Listener (. wikipedia, Vogel, IBM).

, SO .

/ Android, Handlers, AsyncTasks ( ) Parcelables.

+2
+4

, , google android publish subscribe.

Android Local Broadcast Manager . .

.

+2

I know this is old, but I used GreenBob's EventBus. So far it's great. Much more loosely related to intentions than BroadcastReceivers and LocalBroadcastManagers. Have a look here: http://greenrobot.imtqy.com/EventBus/

0
source

All Articles