title: Android, How to get this to work?
body: <p>First of all please note that I am a noob.</p>
  
  <p>What I am trying to do:
  Call the code in the other class from the activity 
  Once that works I want to start a new activity and call the code from there (please tell me how thats done as well)</p>
  
  <p>I am working off this example:http://stackoverflow.com/questions/7061594/loading-mp3s-into-the-sound-pool-in-android</p>
  
  <p>Right now when I click the button it force quits :(</p>
  
  <p>My code:</p>
  
  <pre><code>class MyApp extends Application {
      private static MyApp singleton;
  
      private static SoundPool mSoundPool;
      private HashMap&lt;Integer, Integer&gt; soundPoolMap;
  
      public static final int A1 = 1;
  
      @Override
      public void onCreate() { // This onCreate is for this class
           super.onCreate();
           singleton = this;
           mSoundPool = new SoundPool(5, AudioManager.STREAM_MUSIC, 0);// Just an example
           soundPoolMap = new HashMap&lt;Integer, Integer&gt;();
  
           soundPoolMap.put(A1,   mSoundPool.load(MyApp.this, R.raw.a,    1));   
      }
  
      public void playSound(int sound) {
          AudioManager mgr = (AudioManager)MyApp.this.getSystemService(Context.AUDIO_SERVICE);
          float streamVolumeCurrent = mgr.getStreamVolume(AudioManager.STREAM_MUSIC);
          float streamVolumeMax = mgr.getStreamMaxVolume(AudioManager.STREAM_MUSIC);    
          float volume = streamVolumeCurrent / streamVolumeMax;
  
          mSoundPool.play(soundPoolMap.get(sound), volume, volume, 1, 0, 1f);     
      }
  
      public static MyApp getInstance() {
           return singleton;
      }
  
      public SoundPool getSoundPool() {
           return mSoundPool;
      }
  }
  
  
  public class TestAndroidGlobalsActivity extends Activity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
      }
  
          public void next_activity(View v) 
          {
          //MyApp.getInstance().getSoundPool().playSound(1);
  MyApp.getInstance().playSound(1);
  
          }
  }
  </code></pre>
  
  <p>My manifest file if you need it:<br>
  <a href="http://pastebin.com/YHjgGPyd" rel="nofollow">http://pastebin.com/YHjgGPyd</a>  </p>
  
  <p>Thanks!<br>
  Ryan</p>