Android Question Complete httpjob after pause activity

devmobile

Active Member
Licensed User
I use httpjob in service and when jobdone,i send it with callsubdelay to activity
When jobdone complete,send result to activity
If user press home before complete request job and go to home,after complete jobdone,i cannot send result to activity because it is pause
And when user again return to app,the user encounters with blank list
How do i complete job and when activity shown,show result?
 

KMatle

Expert
Licensed User
Longtime User
There are several ways.

1. You can save the results to a file (List with maps f.e.). In Activity_Resume you can check if this file exists and display the results. If you could call the sub in your activity (it was not in the background) display the data and delete the file (if the app was wiped)

2. Store the data (List with maps) in Process_Globals. In Activity_Resume check if the list is initialized (= data available) and display it (if your app was just in the background)

3. You could start the Activity by code before you use "callsubdelayed" (not nice for the user because your app "appears" out of the blue), but we're talking about 1-2 secs after he/she has pressed the home button.

4. I would be harder to the user. Forget the results and start from where the user was (maybe the data has changed, too)
 
Upvote 0

devmobile

Active Member
Licensed User
There are several ways.

1. You can save the results to a file (List with maps f.e.). In Activity_Resume you can check if this file exists and display the results. If you could call the sub in your activity (it was not in the background) display the data and delete the file (if the app was wiped)

2. Store the data (List with maps) in Process_Globals. In Activity_Resume check if the list is initialized (= data available) and display it (if your app was just in the background)

3. You could start the Activity by code before you use "callsubdelayed" (not nice for the user because your app "appears" out of the blue), but we're talking about 1-2 secs after he/she has pressed the home button.

4. I would be harder to the user. Forget the results and start from where the user was (maybe the data has changed, too)
Oh thanks
Om i have a question
Which way other app use it in?
 
Upvote 0

Similar Threads

Replies
3
Views
3K
Replies
36
Views
120K
  • Locked
  • Article
Android Tutorial Google Maps
Replies
192
Views
170K
Top