You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kay-Uwe Janssen edited this page Nov 20, 2016
·
8 revisions
Since AndroidAnnotations 2.7
@FragmentArg
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.
@EFragmentpublicclassMyFragmentextendsFragment {
@FragmentArg("myStringArgument")
voidsetOneFragmentArg(StringmyMessage){
// do something with myMessage
}
voidsetMultipleFragmentArgs(@FragmentArgStringanotherStringArgument, @FragmentArg("myDateExtra") DatemyDateArgument){
// do something with anotherStringArgument and myDateArgument
}
}
The fragment builder will hold dedicated methods for these arguments: