Android Question How to avoid activity loading again by itself due to unfinished job.

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi Guys,
I am having a chat activity which checks for msgs in a timer thru a job.Whilst the job is still running and users presses back the previous activity flashes for a sec and the chat activity resumes again by itself.
Then the error comes ESIR is a directory.........
I want to stop the job as soon as the users navigates out. There should be some way for this.I cannot manage with boolean flags in this case i guess.
I am using HttpUtils2 for job.
Please guide me.
Juzer
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
You might want to make your job in a service
and in job_Done , you check
B4X:
if IsPaused(yourActivityName)=False Then
'Add new messages with something like this
CallSubDelayed2(yourActivityName,"Add_Messages",messagedata)
End if
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Upvote 0
Top