forked from androidannotations/androidannotations
-
Notifications
You must be signed in to change notification settings - Fork 0
@AfterXXX call order
dodgex edited this page Sep 23, 2014
·
1 revision
The calling order of methods with the same annotation within a class cannot be guaranteed and you should NOT rely on it. If you want multiple methods be called in an ensured order, you should create one method that is annotated and use that to call the other methods in their desired order. If you have to deal with parent/child classes you could try this.
@AfterInject
protected void callInOrder() {
methodA();
methodB();
methodC();
}
private void methodA() {
// your code
}
private void methodB() {
// your code
}
private void methodC() {
// your code
}Note: When @AfterExtras annotated methods are called, all injections that are not related to views are done. Therefore it is safe to use fields that are annotated with e.g. @Bean. The views are only available when the @AfterViews annotated methods get called.
-
@AfterExtras methods get called every time a new
Intentreaches theActivity. -
@AfterViews will be called everytime
setContentView()is called. (Activityonly)
AndroidAnnotations was created by Pierre-Yves Ricau and was originally sponsored by eBusinessInformations.
10/07/2015 The 3.3.2 release is out !
- Get started!
- Download
- Cookbook, full of recipes
- Customize annotation processing
- List of all available annotations
- Release Notes
- Examples
- Read the FAQ
- Join the Mailing list
- Create an issue
- Tag on Stack Overflow
- Ask on Gitter