my game is still running when the user or turn off the screen or when you click the start button my idea is to put a component that when the user leaves the activity that is running do certain actions (I do not know if I understood)
What typeof game? Provide mote info
It is a type invading space that happens is that when you leave the activity is still running activity
I mean the ships are still moving
That means you are using and it keeps running
and how do I avoid that ???
That’s how I do to stop the clock?
You can use extension taifun tools https://puravidaapps.com/tools.php
Possible values are pause , stop and resume in ActivityStateChanged
When You click home button on Your phone activityState have value pause. You can close app in that moment.
I am sending this message with phone, later I can sent You blocks.