Merge "Add some more @Nullable annotations"

This commit is contained in:
Scott Kennedy
2015-02-23 19:09:18 +00:00
committed by Android (Google) Code Review
3 changed files with 9 additions and 7 deletions

View File

@@ -1244,7 +1244,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
* @param savedInstanceState If the fragment is being re-created from
* a previous saved state, this is the state.
*/
public void onCreate(Bundle savedInstanceState) {
public void onCreate(@Nullable Bundle savedInstanceState) {
mCalled = true;
}
@@ -1310,7 +1310,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
* @param savedInstanceState If the fragment is being re-created from
* a previous saved state, this is the state.
*/
public void onActivityCreated(Bundle savedInstanceState) {
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
mCalled = true;
}

View File

@@ -16,6 +16,7 @@
package android.preference;
import android.annotation.Nullable;
import android.annotation.StringRes;
import android.annotation.XmlRes;
import android.app.Fragment;
@@ -531,7 +532,7 @@ public abstract class PreferenceActivity extends ListActivity implements
}
@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Theming for the PreferenceActivity layout and for the Preference Header(s) layout

View File

@@ -16,6 +16,7 @@
package android.preference;
import android.annotation.Nullable;
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
@@ -153,15 +154,15 @@ public abstract class PreferenceFragment extends Fragment implements
}
@Override
public void onCreate(Bundle savedInstanceState) {
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mPreferenceManager = new PreferenceManager(getActivity(), FIRST_REQUEST_CODE);
mPreferenceManager.setFragment(this);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
TypedArray a = getActivity().obtainStyledAttributes(null,
com.android.internal.R.styleable.PreferenceFragment,
@@ -177,7 +178,7 @@ public abstract class PreferenceFragment extends Fragment implements
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
if (mHavePrefs) {