Cancel All Volley Requests Android

前端 未结 9 1301
我在风中等你
我在风中等你 2020-12-05 14:23

At the moment i´m using mRequestQueue.cancelAll(getActivity()) at on stop method in a fragment but apparently when i move the phone from landscape to portrait it is still re

9条回答
  •  借酒劲吻你
    2020-12-05 15:00

    Check this article. It uses Oto as the singleton Event bus. This way you can notify the volley queue when your Activity or Fragments get recreated. You can of course use a plain old Interface instead and listen on the changes. BUt Otto looks much less verbose and elegant as a unified solution.

    http://andraskindler.com/blog/2013/eventbus-in-android-an-otto-example/

提交回复
热议问题