This repository has been archived by the owner on Feb 26, 2023. It is now read-only.
@AfterXXX call order
Kay-Uwe Janssen edited this page Oct 9, 2016
·
2 revisions
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
Intent
reaches theActivity
. -
@AfterViews will be called everytime
setContentView()
is called. (Activity
only)
19/11/2020 The 4.8.0 release is out !
- Get started!
- 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