greenrobot / EventBus

Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.
http://greenrobot.org/eventbus/
Apache License 2.0
24.69k stars 4.66k forks source link

harmonyOS4.2 can receive events when connect with USB,and cant receive events when disconnect with USB, WHY? #728

Open iceblove opened 1 week ago

iceblove commented 1 week ago

Hi, all

I've met an issue very strange: my phone is Huawei Nova 9 with HarmonyOS 4.2, and I use eventBus in my APP to transfer events from an Activity to a Service in the APP,and all the two components have already registered to the default eventBus.

When the phone connect to my macbook pro wiith USB-wire , then all events come from eventBus can received and handle perfectly, but when I disconnnect the USB -wire from the macbook pro, the service could not receive any events. WHY?

greenrobot-team commented 1 week ago

Maybe verify that both instances of the activity and service are alive and in the same process.

You can also look through existing issues or do an internet search to help guide you to a solution.