什么用的@nullable以及在什么情况下不使用@nullable在onCreate(@nullable Bundle SavedInstances);
OnCreate中@nullable的用法(@nullable Bundle savedInstances);?
0
A
回答
1
可以放心地忽略/从OnCreate(@nullable Bundle savedInstances);
删除@nullable
,因为它代表的参数,Bundle
可以为空,它在运行时没有任何作用See the Documentation here for more details
1
可空
是一个问题,表示一个参数,字段或方法的返回值可以为null。
装饰方法调用参数时,这表示 参数可以合法地为空,并且该方法将优雅地与其一起处理 。通常用于可选参数。
装饰方法时,这表示该方法可能合法 返回null。
这是一个标记注释,它没有特定的属性。
https://developer.android.com/reference/android/support/annotation/Nullable.html
相关问题
- 1. Xamarin.Forms中的Nullable TimePicker
- 2. 年Nullable DateTime
- 3. Guice @Nullable annotation
- 4. Flask-SQLAlchemy nullable = False
- 5. dagger2 non @ Nullable @Provides方法
- 6. 无法访问Nullable Dagger2 Android
- 7. @Nullable java的意义(android)
- 8. “Convert.ToString(Nullable <int>)”和“Nullable <int> .ToString()”之间的区别?
- 9. 在FunctionalInterface中处理@Nullable lambda
- 10. @Nullable与泛型(Eclipse中)
- 11. 为什么我不能写Nullable <Nullable <int>>?
- 12. 在Oracle中用NULLable列优化查询
- 13. C#使用数据集将oracle nullable int移动到sql server nullable int
- 14. 将Nothing转换为Nullable(Of)
- 15. IValidatableObject和Nullable值类型
- 16. System.Data.SqlTypes或NULLABLE本机类型?
- 17. JPA group by和Nullable Fields
- 18. MVCContrib Grid和nun-nullable参数
- 19. Wicket“nullable”组件视图
- 20. DirectCast(False,Nullable(Of Boolean))错误
- 21. Doctrine MongoDB ODM nullable = false不起作用
- 22. 使用Rcpp :: Nullable与RcppArmadillo类型错误
- 23. 如何在设置中创建Nullable DateTime?
- 24. Nullable(Of T)的空值是什么?
- 25. @NonNull和@Nullable的正确用法是什么?
- 26. FragmentActivity NullPointer onCreate savedInstanceState Bundle
- 27. Nullable List <>作为输出参数
- 28. 如何根据定义使'struct'为Nullable?
- 29. LINQ查询NULLABLE日期时间字段
- 30. 为什么Nullable <>不隐藏GetType?