summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/Fragment.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-05-30 15:59:53 -0700
committerTor Norbye <tnorbye@google.com>2013-09-11 14:55:38 -0700
commitd9273d6f289d9b55da3fd0db2f659fdfb48106a8 (patch)
treedd8bf34b123a4327a7fc55c944adf62e25aaa50d /core/java/android/app/Fragment.java
parent78d00050272d796cc77557b9b715604d1c566c01 (diff)
downloadframeworks_base-d9273d6f289d9b55da3fd0db2f659fdfb48106a8.zip
frameworks_base-d9273d6f289d9b55da3fd0db2f659fdfb48106a8.tar.gz
frameworks_base-d9273d6f289d9b55da3fd0db2f659fdfb48106a8.tar.bz2
Add typedefs and nullness annotations.
This changeset adds in typedef annotations (custom annotations marked with @IntDef) for various int parameters and return values in the API. It also adds nullness annotations for cases where the documentation explicitly mentioned null policy, or where it was blindingly obvious from the context. Also fixed some typos in the documentation. Change-Id: Ica27c01368895818e26237544edd8483007155bb
Diffstat (limited to 'core/java/android/app/Fragment.java')
-rw-r--r--core/java/android/app/Fragment.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/java/android/app/Fragment.java b/core/java/android/app/Fragment.java
index d626e5f..c09da87 100644
--- a/core/java/android/app/Fragment.java
+++ b/core/java/android/app/Fragment.java
@@ -17,6 +17,7 @@
package android.app;
import android.animation.Animator;
+import android.annotation.Nullable;
import android.content.ComponentCallbacks2;
import android.content.Context;
import android.content.Intent;
@@ -575,7 +576,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
* the given fragment class. This is a runtime exception; it is not
* normally expected to happen.
*/
- public static Fragment instantiate(Context context, String fname, Bundle args) {
+ public static Fragment instantiate(Context context, String fname, @Nullable Bundle args) {
try {
Class<?> clazz = sClassMap.get(fname);
if (clazz == null) {
@@ -1213,7 +1214,8 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
*
* @return Return the View for the fragment's UI, or null.
*/
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ @Nullable
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
Bundle savedInstanceState) {
return null;
}
@@ -1228,7 +1230,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
* @param savedInstanceState If non-null, this fragment is being re-constructed
* from a previous saved state as given here.
*/
- public void onViewCreated(View view, Bundle savedInstanceState) {
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
}
/**
@@ -1237,6 +1239,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
*
* @return The fragment's root view, or null if it has no layout.
*/
+ @Nullable
public View getView() {
return mView;
}