From 6aff2314b3531ce145d5c80ddfdb97200f233570 Mon Sep 17 00:00:00 2001 From: KingJA Date: Sun, 4 Jun 2017 21:21:37 +0800 Subject: [PATCH] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ada7a35..95099bf 100644 --- a/README.md +++ b/README.md @@ -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