Android Question Wait For Http Job - activiry pause

Discussion in 'Android Questions' started by fasilosman, May 8, 2019.

  1. fasilosman

    fasilosman Active Member Licensed User

    I am using okHttpUtils2 with wait for

    I have 2 activities
    I use wait for some http jobs in activity one. Before the jobs complete or done, user starts another activity.

    My problem here is when the job completes in activity one, activity two is paused and activity one started.

    I need to release or close or cancel all waiting jobs when the activity one is paused or closed.

    Is there possibility to do it.
  2. DonManfred

    DonManfred Expert Licensed User

    you should move the jobs to the starter service and raise an event in the calling activity when the job finishes and the activity is still running.
    fasilosman, Erel and MarkusR like this.
  3. MarkusR

    MarkusR Well-Known Member Licensed User

    or move the jobs into a class and use this class in a starter service :)
    fasilosman likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice