How IntentBuilder works: Annotations and Generated Classes
masterIntentBuilder uses annotation processing to provide type-safe intent creation.
- Annotate: Mark your
ActivityorServiceclasses with the@IntentBuilderannotation. - Generation: The library automatically generates a builder class named
[YourClassName]IntentBuilder. For example,DetailActivityresults inDetailActivityIntentBuilder. - Define Extras: Use the
@Extraannotation on fields within your Activity or Service to define which intent extras should be mapped to those fields. - Optional Extras: Use
@Extra @Nullableto mark an extra as optional. - Injection: Use the static
inject(Intent intent, T target)method on the generated builder class to populate the annotated fields of your Activity or Service instance from an incoming Intent.