Android Question How to make progressbar continue even in activity_pause?

Fábioriscado

New Member
I have a progressbar in an application and I wanted the progression of the bar to continue always, even when application is paused. At this moment when I return to the application progressbar restarts in the place where it stopped, and I do not intend this.
 

azzam223

Active Member
Licensed User
Longtime User
you can save the state of the progressbar value by statemanger module or in text file when the app is pause the restore it when it continue
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You have two options:
1. Move the timer and the tick event to the starter service. It will continue to run when the activity is paused. You can use CallSub to call a sub in the activity with the updated value (make sure to track the value in the service).

2. Store the pausing time in a process_global variable when the activity is paused and calculate the new value in Activity_Resume.
 
Upvote 0
Top