I am creating an Android application that includes several short sound clips. Right now I'm using SoundPool to load my sound clips after 2nd activity starts with menu activity. The problem that I seem to encounter is that after starting this secondary action, loading sound clips causes multiple heap size overflows, and then after the bit actually loads activity (the emulator never gives an error or forced termination). Will using MediaPlayer help me here and save those heap size overflows?
In addition, at the moment, the action in the menu starts the 2nd operation, awaiting the result (using the startActivityForResult() function). Does this mean that the menu activity is stored in memory, and also loads the 2nd activity into memory? If so, can I help with memory problems by calling finish() in the menu action after starting the second (then restarting the menu action when the user wants to return to the menu, or will this lead to a whole new set of questions?)?
source share