What is the difference between getView() and getActivity()?
getView()
getActivity()
I have used both methods but don\'t understand the basic difference even method
getActivity() returns the Activity hosting the Fragment, while getView() returns the view you inflated and returned by onCreateView. The latter returns a value != null only after onCreateView returns
Activity
Fragment
onCreateView
!= null