Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Incompatibility with otto library since 3.1 #1133

Closed
arnaudruffin opened this issue Sep 10, 2014 · 4 comments · Fixed by #1134
Closed

Incompatibility with otto library since 3.1 #1133

arnaudruffin opened this issue Sep 10, 2014 · 4 comments · Fixed by #1134
Labels
Milestone

Comments

@arnaudruffin
Copy link

Hi everyone and thanks for this great framework

I haven't been able to use otto library with androidannotation since the 3.1 is out (I was silly enough to put 3.+ version in my gradle file, and was going crazy not understanding why my project was suddenly not working)

Posting event to the bus event doesn't trigger anything...

OttoVersion=1.3.5
AndroidAnnotationsVersion=3.0.1

Here is an example

My bus event is declared in a EBean

@EBean(scope = EBean.Scope.Singleton)
public class DebugBusProxy {

    protected final Bus bus = new Bus();
....

And a test activity example:

@EActivity(R.layout.activity_my)
public class MyActivity extends Activity {

    @Bean
    DebugBusProxy bus;

    public static class MyEvent{}

    @Override
    protected void onResume() {
        super.onResume();
        bus.register(this);
        bus.post(new MyEvent());
    }

    @Subscribe
    public void myMethodActivity(MyEvent e){
        Log.d(MyActivity.class.getName(),"Never called.. :(");
    }
}

I'm willing to contribute, and may have a look in the next few days. Just posting it there in case someone already have an idea or is facing the same problem...

@yDelouis
Copy link
Contributor

This is related to #1131.

@WonderCsabo
Copy link
Member

@yDelouis I think we should re-add ProduceHandler and SubscribeHandler, since we break otto because of subclassing. Without AA, the code above would work.

@yDelouis
Copy link
Contributor

Yes, we should re-add them until Otto can walk through parent classes.

@WonderCsabo
Copy link
Member

I am preparing a PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants