forked from androidannotations/androidannotations
-
Notifications
You must be signed in to change notification settings - Fork 0
FragmentArg
DayS edited this page Apr 16, 2013
·
5 revisions
Since AndroidAnnotations 2.7
The @FragmentArg annotation indicates that a fragment field should be injected with the corresponding Fragment Argument.
The setter method in the generated builder will always have the same name as the argument. By default, the key used to bind the value is the field name, but you can change it by providing a value to the @FragmentArg annotation.
Usage example:
@EFragment
public class MyFragment extends Fragment {
@FragmentArg("myStringArgument")
String myMessage;
@FragmentArg
String anotherStringArgument;
@FragmentArg("myDateExtra")
Date myDateArgumentWithDefaultValue = new Date();
}The fragment builder will hold dedicated methods for these arguments:
MyFragment myFragment = MyFragment_.builder()
.myMessage("Hello")
.anotherStringArgument("World")
.build();AndroidAnnotations was created by Pierre-Yves Ricau and is sponsored by eBusinessInformations.
04/03/2013 The 2.7.1 release is out
- Get started!
- Download
- Cookbook, full of recipes
- List of all available annotations
- Release Notes
- Examples
- Read the FAQ
- Join the Mailing list
- Create an issue
- Tag on Stack Overflow