fix npe when getActivity == null