package onactivityresult; import java.lang.annotation.Retention; import java.lang.annotation.Target; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.CLASS; /** * parameters of a {@link OnActivityResult} annotated method can be annotated to get an extra of the Intent
* The type of the variable will be automatically derived.
*
* Supported types are:
* * Example:
*

* * @OnActivityResult(requestCode = 1) * void onResult(@Extra final String extra) { * // Do something * } * *

*
* extra name: either the value returned by {@link Extra#name()} or the same as the parameter name
* NOTE: In this case it would be extra
*
* Since the type will be derived it's not possible to set a default value via the annotation. In case the Intent does not contain the extra, type default values will be provided automatically.
* If you want set a default value use one of those annotations: {@link ExtraBoolean}, {@link ExtraByte}, {@link ExtraChar}, {@link ExtraDouble}, {@link ExtraFloat}, {@link ExtraInt}, {@link ExtraLong} and {@link ExtraShort} * * @since 0.3.0 */ @Retention(CLASS) @Target(PARAMETER) public @interface Extra { /** * @return the name of the extra parameter which is contained in the Intent * @since 0.6.0 */ String name() default ""; }