package com.wh.finaldemos.demos.otherlibs.otto;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import com.squareup.otto.Subscribe;
import com.wh.finaldemos.R;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class Activity2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_2);
        ButterKnife.bind(this);
        BusProvider.getInstance().register(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        BusProvider.getInstance().unregister(this);
    }

    @OnClick(R.id.but1)
    void onBut1Click() {
        BusProvider.getInstance().post(new MyEvent());
    }

    @Subscribe public void onMyEvent(MyEvent event) {
        Log.e("otto_demo", "event:" + event.a);
    }

    public static class MyEvent {
        int a = 2;
    }
}

@@ -143,16 +143,50 @@
 l.Log;%0A%0A
+import com.squareup.otto.Produce;%0A
 import c
@@ -953,24 +953,155 @@
 .a);%0A    %7D%0A%0A
+    @Produce public MyEvent initialGetMyEvent() %7B%0A        MyEvent me = new MyEvent();%0A        me.a = 10;%0A        return me;%0A    %7D%0A%0A
     public s

Add otto demo produce