onactivityresult.IntentData 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 the {@link android.content.Intent#getData()} of the intent
* Example:
*
*
* @OnActivityResult(requestCode = 1)
* void onResult(final int resultCode, @IntentData final Uri uri) {
* // Do something
* }
*
*
*
* If any annotation with the name Nullable (e.g. google's support annotation or IntelliJs annotation) is applied on this parameter,
* it'll check the {@link android.content.Intent} for non null first and then try to get the intent data.
* If the intent or the data is null, null will be returned.
*
*
* If any annotation with the name NotNull or NonNull (e.g. google's support annotation or IntelliJs annotation) is applied on this parameter,
* it'll check the {@link android.content.Intent} for non null first and then check that the intent data is also not null.
* If the intent or the data is null an exception will be thrown.
*
* @since 0.2.0
*/
@Retention(CLASS)
@Target(PARAMETER)
public @interface IntentData {}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy