-
Event sending and receiving is based on Eventbus, and IPC communication is based on an easy-to-use Android IPC library.
First, select one process as the main process and the other processes as the sub-processes.
Each time an event is sent, it goes through the following four steps:
1. Use the hermes library to pass the event to the main process.
2. The main process uses eventbus to send events inside the main process.
3. The main process uses the hermes library to pass the event to all the child processes.
4. Each sub-process uses eventbus to send events inside the sub-process. Usage.
-
hermeseventbus
Wangchang Qiaopai page wide link envy.
-
Hermes-EventBus is an Eventbus-based library for sending and receiving events between processes, which is very useful for IPC or plug-in development. It is based on the underlying of.
EventBus and EventBus has the same API as Excite.
Principle. Event collection is based on Eventbus, and IPC communication is based on an easy-to-use Android IPC library.
-
1ãeventbus
2. Make your project rely on Eventbus
3. Customize an event (no need to inherit any class), usually I prefer to define a message class.
4. Define the ** function, which is equivalent to the on***listener function in the observer mode, and you can define four types of ** functions in eventbus:
a, onevent It corresponds to the postthread in the threadmodel, which is also the default type, when this type is used, the ** function and the function that initiated the event will be executed in the same thread.
b. OnEventMainThread, when this type is used, the ** function will be executed in the main thread, which is very useful in Android, because it is forbidden to modify the UI in the child thread in Android
c. oneventbackgroundthread, when using this type, if the event initiator function is executed in the main thread, then the ** function starts another sub-thread, and if the event initiator function is executed in the sub-thread, then the ** function is executed in this sub-thread.
d. oneventbusasync, when this type is used, no matter if the event initiator function is executed in **, another thread will be started to execute**.
The soy milk is good, I like it very much, VV's peanut flavor. And I heard that soy milk is more nutritious than pure milk, but you are hungry at night to drink milk? Anyway, you have to eat something, eat some starch, bread, cakes, biscuits, but eat at night with a sound, like a mouse.
You can make a white fungus soup, it's very simple, just put the ingredients together in the pot and boil, and it's also beautiful and beautiful, I often drink it. >>>More
Have a family history that indicates you are predisposed to diabetes. >>>More
Di Renjie has been reworked, and the new skills are as follows. >>>More
If someone you love has given up on you, let go of yourself so that you have the opportunity to love others. >>>More