Im writing an application (game) where I would like to end the game when the user leaves the game. My game is loosely based on the lunarlander, so I find it easier to ask for help using lunarlander as an example, as many are familiar with it.
When the user fails in the lunarlander game, I want to automatically complete the action (because my application uses more than one action). I know that I can use the finish () method inside the activity class, but I cannot use this method inside the surfaceview class or its nested stream. What can I do from this class, which can be used to complete an action or create a trigger for an activity class?
Or is there a completely different way that I should approach this?
Thank.
source
share