-
Notifications
You must be signed in to change notification settings - Fork 846
Problem using it with AndroidAnnotations #61
Comments
This will come with 2.0 when class hierarchy walking is restored. This was intentionally removed for the 1.x versions. |
I appreciate the decision, and it's easy enough to work around with enough care. That said, gIven how easy it is to accidentally subscribe to events in a class and then subclass it, I wonder if either of these would be useful:
In my code base, this is effectively what I've tried to do to avoid accidentally losing events. |
So, quick experiment leads me to the fact that anonymous inner classes are non-final (I'm sure there's a good reason). Oh well. |
@JakeWharton I seem to have an error with unregistering Subscribers using 2.0 snapshot. It's the IllegalArugmentException "Missing Subscriber...". Do you have to handle subscription differently in 2.0? |
I wasn't even aware 2.0 compiled, to be honest. |
The clean android code project uses it because the change is necessary for
|
Yes, but it's a long way from actually being a shippable version of the library. It doesn't surprise me at all that there are problems with it. I wouldn't recommend using it until we move it to the |
That's what I was afraid of. I thought I would give it a try to find out
|
Well I'm starting actual 2.0 development today or tomorrow so it should move forward quickly. As it exists now it's more of a proof-of-concept. |
Oh, awesome! Is there anything I can follow to see if I can contribute to
|
All issues relevant to its development will be organized on the 2.0 milestone of the project. |
I need to rebase it first, though, since the branch is about 6 months out of date. |
Got it.
|
@JakeWharton what is the status of the 2.0 branch? Did you reject to continue development in that way? |
Nobody is working on it. We have no plans to release 2.0 at this time.
|
#135 will restore hierarchy walking. |
I tried using dagger with AndroidAnnotations within activities.
The problem is that AndroidAnnotations creates a subclass of my activity.
When you look for annotated subscribers in com.squareup.otto.AnnotatedHandlerFinder#loadAnnotatedMethods you use listenerClass.getDeclaredMethods()
This does not return the methods from the super-class. So I can not receive messages if I create a subclass of the class that contains subscribe methods.
I got around this by registering an anonymous class with an annotated method.
Not sure if you want to support this, just mentioned it.
Thanks,
Gabi
The text was updated successfully, but these errors were encountered: