Annotations in the parent class will create the TemplateActivity_ class with the specified layout. The child class inherits the "normal" material from this parent class, but has its own subclass AA (ChildActivity_). Therefore, you must specify the layout in order to use it. Just take a look at the created classes to see what happens there.
AA works by creating a new subclass for your annotated classes (e.g. TemplateActivity_ extends TemplateActivity) that contains the code needed to achieve the results of your annotations. For example, in this class, the onCreate () method will instantiate the desired layout, methods annotated with @Background are overridden by another implementation that calls the original method in the background thread. AndroidAnnotations doesn't actually do anything at run time, everything can be seen in the classes it creates, just look in the .apt_generated folder (or wherever you generate the classes). It can also be useful if he doesnβt quite do what you want, because then you can just look at what he is doing and do it yourself, as you need it.
In your case, the inheritance hierarchy looks like this:
TemplateActivity (with annotations) L
Afaik not all annotations are passed to subclasses.
source share