tmtron/green-annotations

@EBean support?

Closed this issue · 2 comments

Hi,

Any plan of supporting @EBean lifecycle? (if there is any)
I am using @Bean in @EActivity, @EFragment, maybe we could automatically plug it to the parent lifecycle? onStart, onStop would call the bean's "onCreate", "onDestroy" or something like that.

Sorry, there are no plans to do that.
And I think that green-annotations should not do that: it must be done by android-annotations:
e.g. when you want to use the EventBus in your EBean, then you will use green-annotations in the EBean - but the Activity may not even need to know about green-annotations at all (i.e. there is only the EActivity annotation on the Action): and thus the EActivity annotation should handle the life-cycle aware EBean.

There was an AndroidAnnotations-issue "lifecycle aware beans #843" for such an idea, but has been closed.

Thanks for pointing to the AA idea, i'll look what came out of it :)