@Retention(value=CLASS)
@Target(value=FIELD)
public @interface Extra
Use on any native, Parcelable
or Serializable
field in an
EActivity
annotated class to bind it with Android's extra.
The annotation value is the key used for extra. If not set, the field name will be used as the key.
When Extra
is used, the intent builder will hold dedicated methods
for each annotated fields.
Your code related to injected extra should go in an AfterInject
annotated method.
Calling Activity.setIntent(android.content.Intent)
will automatically
update the annotated extras.
Example :@EActivity public class MyActivity extends Activity { @Click void buttonClicked() { MyExtraActivity_.intent(this) // .myMessage("test") // .startActivity(); } } @EActivity public class MyExtraActivity extends Activity { @Extra String myMessage; @AfterInject void init() { Log.d("AA", "extra myMessage = " + myMessage); } }
AfterInject
,
EActivity
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String |
value |
Copyright © 2010-2014. All Rights Reserved.