How to solve the problem that Fragment getActivity () getContext () gets a null return after the API callback

    The context, development of fragment in the
  1. API callback basically does not reappear, but it always encounters
  2. after each release.
  3. how can this problem be repeated locally?
  4. how to solve the problem when getActivity () getContext () returns empty? I hope you can give us some good methods and suggestions
Mar.21,2021

Don't say you're an interface, Fragment itself has some lifecycle functions that return null. You can first check what status of Fragment is to get Context.
Menu