onOptionsItemMenuSelected() onActivityCreated Fragment Fragment Fragment developer.android.com/reference/android/app/… <fragment> Fragment onActivityCreated developer.android.com/reference/android/app/… documentation for Fragment Fragment Fragment Official Support v4 Fragment Documentation documentation Fragment Fragment Fragment Fragment#onCreateView Fragment public void setRetainInstance(true) isAdded() android.app.Fragment Fragment developer.android.com/reference/android/app/Fragment.html fragments <fragment> Android Fragment Fragment developer.android.com/reference/android/app/Fragment.html Fragment Fragment Fragment#setMenuVisibility Fragment Fragment developer.android.com/reference/android/app/Fragment.html Fragment onDestroyView() onAttach() Fragment.onCreateView() Fragment getActivity() Fragment Fragment API Fragment getActivity() Fragment <fragment> Fragment Fragment Fragment Fragment Fragment Fragment Android Fragment onActivityCreated Fragment developer.android.com/reference/android/app/Fragment.html android.app.Fragment Fragment onDestroyView() Fragment Fragment Fragment developer.android.com/reference/android/app/Fragment.html Fragment Fragment Fragment Fragment Fragment Fragment Fragment Class Fragment Fragment setRetainInstance Fragment Fragment Fragment android.app.Fragment setRetainInstance(boolean) Fragments Fragment Fragment android.app.Fragment onDestroyView() Fragment setArguments(Bundle b) Fragment onActivityCreated() Fragment Fragment Android Fragment setRetainInstance(boolean) developer.android.com/reference/android/app/… setRetainInstance() Fragment setRetainInstance() Fragment Fragment Fragment Android Fragment Fragment Fragment android.app.Fragment Fragment Fragment Fragment developer.android.com/reference/android/app/… <fragment> Fragment Fragment android.app.Fragment Official Fragment Documentation Fragment Android Fragment doco Lifecycle of Fragment Fragment Fragment Fragment FragmentActivity Fragment Fragment Fragment Fragment#setInitialSavedState getActivity() method Fragment.setMenuVisibility() setRetainInstance(true) onOptionsItemSelected() setRetainInstance(boolean) docs for onPrepareOptionsMenu Fragment Fragment