fix getActivity may be null problem