Question

So I fixed some other bugs I had with my app and a new annoying bug arose. I can run my game fine and everything works well. The problem is when I exit the app and then go into recent apps from my home and then I click on my game, the screen turns black (Game loop is still running though). I put a line of code in the onCreate(),onPause() and onResume() methods to tell me when they are called. This is the order they get called when I start the app:

onCreate() then --> onResume() I then exit my app: onPause()

But when I return, onResume() does not appear in logcat and neither does onCreate() if you were wondering. Thank you!

Also, there are no errors that show up in LogCat.

EDIT, heres my code (p.s. Anaglyph is the name of my game and the name of the gameview class):

GameView(Anaglyph.class): Paste Bin Entry 1

GameThread(MainThread.class): Paste Bin Entry 2

MainActivity(MainActivity.class): Paste Bin Entry 3

Was it helpful?

Solution

If anyone's code looks like mine and you have the same problem, just restructire your program using this example:http://androidhelpkatariya.blogspot.ca/2012/11/surface-view-example.html Hope it helps, worked great for me!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top