D
D
Drottarutarnum2019-09-05 00:31:27
Java
Drottarutarnum, 2019-09-05 00:31:27

How to distribute events among all activities?

I inherit from the Application class and create a DeviceProtocol class variable there.
DeviceProtocol is responsible for connecting to the device via BLE, because inside there are methods that require activation, then I pass this to it from SplashScreen (for this reason, I have to not destroy SplashScreen)
Next, I need to somehow make events, for example, onBatLevelUpdate, to which a bunch of other activities should subscribe.
That's actually the question, t .to. googling "android event" returns only element events

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Eremin, 2019-09-05
@EreminD

Reactive programming?
RxJava, RxAndroid to the rescue

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question