MCPcopy
hub / github.com/greenrobot/EventBus / postSticky

Method postSticky

EventBus/src/org/greenrobot/eventbus/EventBus.java:311–317  ·  view source on GitHub ↗

Posts the given event to the event bus and holds on to the event (because it is sticky). The most recent sticky event of an event's type is kept in memory for future access by subscribers using Subscribe#sticky().

(Object event)

Source from the content-addressed store, hash-verified

309 * event of an event's type is kept in memory for future access by subscribers using {@link Subscribe#sticky()}.
310 */
311 public void postSticky(Object event) {
312 synchronized (stickyEvents) {
313 stickyEvents.put(event.getClass(), event);
314 }
315 // Should be posted after it is putted, in case the subscriber wants to remove immediately
316 post(event);
317 }
318
319 /**
320 * Gets the most recent sticky event for the given type.

Calls 1

postMethod · 0.95