Android Question How to run a sub-routine when activity pauses, but not when running another activity?

Tim Chapman

Active Member
Licensed User
Longtime User
I have a sub-routine that runs when the Activity_Pause is called.
I added another activity to my code.
Now, whenever I switch activities, the sub-routine runs.
I don't want it to run when I switch activities. Only when the app pauses due to time out, etc.
How do I differentiate between these two pauses and avoid running the sub-routine when the other activity is called?
 

Tim Chapman

Active Member
Licensed User
Longtime User
Sorry. I figured this one out. A button is clicked to call the other Activity. I made a flag in the button_clicked sub that gets checked when Activity_Paused is called. If the flag is set, the sub is not called.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…