Android Question Closed activity comes back if a httpjob is running

Alessandra Pellegri

Active Member
Licensed User
Longtime User
In my app there are two activities. The Main call the second. During the second occurs some httpjob.
In keypress event second activity there is:
B4X:
  If KeyCode = KeyCodes.KEYCODE_BACK Then
     Activity.Finish
     StartActivity(Main)
     Return True
   End If

So if the user press back button the second activity closes and comes back the Main.
But if the httpjob is still running, the JobDone event may be called when the second activity is already closed. So when JobDone event occurs the second activity comes back.

How could I fix this ?

Thank you
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…