Been having a persistent problem that I can't seem to fix from the Java side. Here goes. As you know, the SDL surface starts a second thread which calls NativeMethods.init() which gets the whole core running. Everything works great. Problem is when we go to quit the core.
- User clicks to return to main menu
- UI thread calls finish() on GameActivity
- Android fires a sequence of lifecycle methods, in the process destroying the SDL surface.
- In the SDL surfaceDestroyed callback, we call NativeMethods.quit(), and wait for core shutdown and thread join.
Ideally, Android would pop the activity stack to return us to the MainMenu. Instead, Android pops the stack twice (which I verified with some extra dummy activities) but never crashes. No warnings or errors in the logcat, everything just as you would expect... except for the extra popped activity. So it's like something on the C++ side is sending an extra pop. Have you noticed this or have any ideas what's going on?