Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KingJA authored Jun 4, 2017
1 parent c7c0235 commit 6aff231
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
RxBus.getDefault().register(this);
```

#### step 2: receive
#### step 2: receive&post
```java
//receive
@Subscribe
public void receiveEventMain(EventMain event) {
((TextView) findViewById(R.id.tv_main_eventMsg)).setText(event.getMsg());
}
//post
RxBus.getDefault().post(new EventMain());
```
#### step 3: unregister
```java
Expand Down

0 comments on commit 6aff231

Please sign in to comment.