什麼用的@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?