All Downloads are FREE. Search and download functionalities are using the official Maven repository.

onactivityresult.ExtraShort Maven / Gradle / Ivy

There is a newer version: 0.6.0
Show newest version
package onactivityresult;

import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.CLASS;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * parameters of a {@link OnActivityResult} annotated method can be annotated to get a short extra of the Intent
* Example:
*

* * @OnActivityResult(requestCode = 1) * void onResult(@ExtraShort final short extraShort) { * // Do something * } * *

*
* extra name: same as parameter
* NOTE: In this case it would be extraShort
*
* NOTE: If you don't care about the {@link ExtraShort#defaultValue()} you can also use the {@link Extra} annotation
*
* * @since 0.3.0 */ @Retention(CLASS) @Target(PARAMETER) public @interface ExtraShort { /** * @return the set default value if the extra is not set on the intent * @since 0.3.0 */ short defaultValue() default 0; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy