AndroidAnnotations——Injecting FragmentArg注入Fragment参数
2014-04-06 15:47
489 查看
目录(?)[+]
FragmentArg
FragmentArg
本文档的简单示例下载
The
Fragment Argument.
注解表明Fragment字段应该由相应的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
annotation.
生成的构造器中的setter方法的命名会一直和参数一样。以往在默认情况下,键根据字段名绑定值,但是现在你可以通过提供一个值给
注解来改变这个现状。
Usage example:用例:
The fragment builder will hold dedicated methods for these arguments:
Fragment构造器对这些参数提供了专门的方法:
FragmentArg
FragmentArg
本文档的简单示例下载
FragmentArg
Since AndroidAnnotations 2.7
@FragmentArg
The @FragmentArgannotation indicates that a fragment field should be injected with the corresponding
Fragment Argument.
@FragmentArg
注解表明Fragment字段应该由相应的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.
生成的构造器中的setter方法的命名会一直和参数一样。以往在默认情况下,键根据字段名绑定值,但是现在你可以通过提供一个值给
@FragmentArg
注解来改变这个现状。
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:
Fragment构造器对这些参数提供了专门的方法:
MyFragment myFragment = MyFragment_.builder() .myMessage("Hello") .anotherStringArgument("World") .build();
本文档的简单示例下载
本例子仅改写android Master/Detail Flow模板项目
相关文章推荐
- AndroidAnnotations——Injecting FragmentArg注入Fragment参数
- AndroidAnnotations——Injecting FragmentArg注入Fragment参数
- AndroidAnnotations——Injecting project Resources注入项目资源
- AndroidAnnotations——Injecting SystemServices注入系统服务
- AndroidAnnotations——Injecting project Resources注入项目资源
- AndroidAnnotations——Injecting html注入html文本
- AndroidAnnotations——Injecting SystemServices注入系统服务
- AndroidAnnotations——Injecting html注入html文本
- Android框架攻击之Fragment注入
- Android框架攻击之Fragment注入
- Android Fragment注入漏洞
- AndroidAnnotations——Injecting Views视图注入
- Android框架层漏洞-Fragment注入
- Android框架攻击之Fragment注入,isValidFragment
- AndroidAnnotations——Injecting Views视图注入
- AndroidAnnotations——Injecting Extras注入Extras
- Android 系统设置页面注入Fragment的注意事项
- Android跨进程事件注入 Injecting to another application requires INJECT_EVENTS permission
- Dagger,ButterKnife,Roboguide,AndroidAnnotations框架的依赖注入浅析
- AndroidAnnotations——Injecting Extras注入Extras