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 a double extra of the Intent
* Example:
*

* * @OnActivityResult(requestCode = 1) * void onResult(@ExtraDouble final double extraDouble) { * // Do something * } * *

*
* extra name: either the value returned by {@link ExtraDouble#name()} or the same as the parameter name
* NOTE: In this case it would be extraDouble
*
* NOTE: If you don't care about the {@link ExtraDouble#defaultValue()} you can also use the {@link Extra} annotation
*
* * @since 0.3.0 */ @Retention(CLASS) @Target(PARAMETER) public @interface ExtraDouble { /** * @return the set default value if the extra is not set on the intent * @since 0.3.0 */ double defaultValue() default 0; /** * @return the name of the extra parameter which is contained in the Intent * @since 0.6.0 */ String name() default ""; }