Code example for Fragment

Methods: getActivity, onCreate, setHasOptionsMenu, setRetainInstance