I am currently creating a game which has a MainActivity as well as a SurfaceView. The SurfaceView is not it's own activity, but is simply called in the MainActivity.
What I am trying to do is have a button on the MainActivity (Pause / Resume) which will pause rendering on the SurfaceView and resume it again when clicked.
I am not entirely sure how I would do this, inside of my SurfaceView (GameView) I can stop my GameLoopThread but if I try to simply restart it (pause and then resume the game) it does nothing.
I have tried with pausing/resuming the activity itself as well as attempting to run my SurfaceView within a boolean run but neither seemed to work.
Any ideas would be appreciated!