onactivityresult.ExtraBoolean Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of onactivityresult-annotations Show documentation
Show all versions of onactivityresult-annotations Show documentation
OnActivityResult annotation compiler for Android
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 boolean extra of the Intent
* Example:
*
*
* @OnActivityResult(requestCode = 1)
* void onResult(@ExtraBoolean final boolean extraBoolean) {
* // Do something
* }
*
*
*
* extra name: same as parameter
* NOTE: In this case it would be extraBoolean
*
* NOTE: If you don't care about the {@link ExtraBoolean#defaultValue()} you can also use the {@link Extra} annotation
*
*
* @since 0.3.0
*/
@Retention(CLASS)
@Target(PARAMETER)
public @interface ExtraBoolean {
/**
* @return the set default value if the extra is not set on the intent
* @since 0.3.0
*/
boolean defaultValue() default false;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy