I'm developing an app for Android, and I want it to pause the music when you press the home button (onPause). That works fine, but then when I try to start up the game again, onResume, onRestart, onStart, onRestoreInstanceState and onCreate are never called and it tells me that the application is not responding. There are no Exceptions shown in the LogCat... So I have no idea what is happening. Does anyone have any suggestions as to why this might be the case?

2 Answers
2

When you get an "application not responding" error, that means that your activity has taken too long on the main application thread. Identify all the work that you are doing on the main application thread and migrate the slow stuff to a background thread or AsyncTask.

I think I may know what my error is: It is running some unneeded code when onSizeChanged is called on the SurfaceView (which i guess might happen when you pause the Activity and something else comes in to view)... I'll check it out. Thanks everyone!