0

Hi i am using AsyncHttpRequestClient to run my network calls which i'm calling from a fragment and a tab bar. when the tab switches to a new fragment i need to cancel any requests that may have been running on the previous fragment. Normally i would do this in onPause but the tabbar and fragments exist within one activity so on pause isn't run. i have a tab bar listener as a seporate class which i could put the cancel call on there however the httpClient is created within the fragment so can't cancel it from the external class. Is there away to detect if fragment is about to change and then cancel my network calls. or is there a way to detect if there are network calls running from my tablistener and cancel it from there?

iamlukeyb
  • 6,487
  • 12
  • 29
  • 40

0 Answers0