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

onactivityresult.Extra 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 an extra of the Intent
* The type of the variable will be automatically derived.
*
* Supported types are:
*
    *
  • boolean
  • *
  • byte
  • *
  • char
  • *
  • double
  • *
  • float
  • *
  • int
  • *
  • long
  • *
  • short
  • *
  • String
  • *
* Example:
*

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

*
* extra name: same as parameter
* 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 deafult 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 {}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy