Skip to content

Commit e1ae50f

Browse files
committed
add @Receiver.Extra
1 parent 1c146db commit e1ae50f

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

  • AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations

‎AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations/Receiver.java‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,27 @@
9797
public enum RegisterAt {
9898
OnCreateOnDestroy, OnStartOnStop, OnResumeOnPause, OnAttachOnDetach
9999
}
100+
101+
/**
102+
* <p>
103+
* Should be used on any native, {@link android.os.Parcelable} or
104+
* {@link java.io.Serializable} parameter of a method annotated with
105+
* {@link ReceiverAction} to inject the extra put in the intent parameter of
106+
* {@code void onReceive(Context context, Intent intent)}. The key of this
107+
* extra is the value of the annotation {@link ReceiverAction.Extra} if it
108+
* is set or the name of the parameter.
109+
* </p>
110+
*/
111+
@Retention(RetentionPolicy.CLASS)
112+
@Target(ElementType.PARAMETER)
113+
public @interface Extra {
114+
115+
/**
116+
* Define the extra's name. If this parameter isn't set the annotated
117+
* parameter name will be used.
118+
*
119+
* @return the extra's name
120+
*/
121+
String value() default "";
122+
}
100123
}

0 commit comments

Comments
 (0)