Use isAdded instead of checking if getActivity is null in fragments