hehonghui / hehonghui/AndroidEventBus

使用jar收不到消息

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.6k
Forks
390
PR merge metrics
No merged PRs in 30d

Description

你好,我用了这个版本的jar,就直接传字符串都收不到消息。在MainActivity的onCreate 中 EventBus.getDefault().register(this); 注册,onDestroy中 EventBus.getDefault().unregister(this);
在button中的点击事件发了这个 EventBus.getDefault().post(new ReceviceEvent("I am send a message"));
然后在SecondActivity 中 @Subscriber(mode= ThreadMode.MAIN)
public void Message(ReceviceEvent s){
Log.e(TAG,"sting ××××××××:"+s.getMessage());
},但是却收不到消息,不知道哪出了问题。能不能帮忙解决一下?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the EventBus registration in MainActivity.onCreate and onDestroy, then trace the button's post call and SecondActivity's @Subscriber method. Reproduce the reported flow and verify the subscriber is registered when the event is posted; done means the message appears in the SecondActivity log.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.