Code example for Fragment

Methods: getActivityonCreatesetHasOptionsMenusetRetainInstance