MediaPlayer - errors
<p>I have strange error, if i have 7 sounds all it ok, but when i have 8 sounds I receive errors. If I comment out no matter which "sound" it works.</p>

<p>Error is only when i clicked mpT (t - imageButton ).</p>

<p>Code:</p>

<pre><code>     public int count = 0;
        MediaPlayer mpTH, mpTLA, mpTNAH, mpTOH, mpTRA, mpTYA, mpTYE, mpT;  
        ImageButton th, tra, tla, tnah, toh, t, tya, tye;

        @Override
        public void onCreate(Bundle savedInstanceState) {

            super.onCreate(savedInstanceState);
            setContentView(R.layout.app);

            //ImageButton
            th = (ImageButton)findViewById(R.id.ibTh);
            tra = (ImageButton)findViewById(R.id.ibTB);
            tla = (ImageButton)findViewById(R.id.ibTLA);
            tnah = (ImageButton)findViewById(R.id.ibNah);
            toh = (ImageButton)findViewById(R.id.ibOh);
            t = (ImageButton)findViewById(R.id.ibTy);
            tya = (ImageButton)findViewById(R.id.ibYa);
            tye = (ImageButton)findViewById(R.id.ibTYE);
            //MediaPlayer
            mpTH = MediaPlayer.create(this, R.raw.th);
            mpTLA = MediaPlayer.create(this, R.raw.tla);
            mpTNAH = MediaPlayer.create(this, R.raw.tnah);
            mpTOH = MediaPlayer.create(this, R.raw.toh);
            mpTRA = MediaPlayer.create(this, R.raw.tra);
            mpTYA = MediaPlayer.create(this, R.raw.tya);
            mpTYE = MediaPlayer.create(this, R.raw.tye);
            mpT = MediaPlayer.create(this, R.raw.test);
            //SetOnClickListener
            th.setOnClickListener(this);
            tra.setOnClickListener(this);
            tla.setOnClickListener(this);
            tnah.setOnClickListener(this);
            toh.setOnClickListener(this);
            t.setOnClickListener(this);
            tya.setOnClickListener(this);
            tye.setOnClickListener(this);
            //set count
            count = 0;
        }


        public void onClick(View v) {
            if (v.getId() == R.id.ibTh)
                thClicked();
            if (v.getId() == R.id.ibTB)
                traClicked();
            if (v.getId() == R.id.ibTLA)
                tlaClicked();
            if (v.getId() == R.id.ibNah)
                tnahClicked();
            if (v.getId() == R.id.ibOh)
                tohClicked();
            if (v.getId() == R.id.ibTy)
                tClicked();
            if (v.getId() == R.id.ibYa)
                tyaClicked();
            if (v.getId() == R.id.ibTYE)
                tyeClicked();

        }
        public void tClicked()
        {
            if(count == 0){
                mpT.start();
                count = 1;
            } else {
                mpT.pause();                
                count = 0;
            }

        }
        public void thClicked()
        {
            if(count == 0){
                mpTH.start();
                count = 1;
            } else {
                mpTH.pause();                
                count = 0;
            }

        }
        public void traClicked()
        {
            if(count == 0){
                mpTRA.start();
                count = 1;
            } else {
                mpTRA.pause();                
                count = 0;
            }
        }
        public void tlaClicked()
        {
            if(count == 0){
                mpTLA.start();
                count = 1;
            } else {
                mpTLA.pause();                
                count = 0;
            }
        }
        public void tnahClicked()
        {
            if(count == 0){
                mpTNAH.start();
                count = 1;
            } else {
                mpTNAH.pause();                
                count = 0;
            }
        }
        public void tohClicked()
        {
            if(count == 0){
                mpTOH.start();
                count = 1;
            } else {
                mpTOH.pause();                
                count = 0;
            }
        }
        public void tyaClicked()
        {
            if(count == 0){
                mpTYA.start();
                count = 1;
            } else {
                mpTYA.pause();                
                count = 0;
            }
        }
        public void tyeClicked()
        {
            if(count == 0){
                mpTYE.start();
                count = 1;
            } else {
                mpTYE.pause();                
                count = 0;
            }
        }




        @Override
        protected void onDestroy() {
            super.onDestroy();
            if(mpTH != null) {
                mpTH.pause();
                mpTH.stop();
                mpTH.release();
                count = 0;
            }
            if(mpT != null) {
                mpT.pause();
                mpT.stop();
                mpT.release();
                count = 0;
            }
            if(mpTLA != null) {
                mpTLA.pause();
                mpTLA.stop();
                mpTLA.release();
                count = 0;
            }
            if(mpTNAH != null) {
                mpTNAH.pause();
                mpTNAH.stop();
                mpTNAH.release();
                count = 0;
            }
            if(mpTOH != null) {
                mpTOH.pause();
                mpTOH.stop();
                mpTOH.release();
                count = 0;
            }
            if(mpTYE != null) {
                mpTYE.pause();
                mpTYE.stop();
                mpTYE.release();
                count = 0;
            }
            if(mpTYA != null) {
                mpTYA.pause();
                mpTYA.stop();
                mpTYA.release();
                count = 0;
            }
            if(mpTRA != null) {
                mpTRA.pause();
                mpTRA.stop();
                mpTRA.release();
                count = 0;
            }
        }

}
</code></pre>

<p>Errors: </p>

<pre><code>03-02 21:37:52.393: E/AndroidRuntime(1344): Uncaught handler: thread main exiting due to uncaught exception
03-02 21:37:52.393: E/AndroidRuntime(1344): java.lang.NullPointerException
03-02 21:37:52.393: E/AndroidRuntime(1344):     at com.test.TestAc.tClicked(Trolo.java:76)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at com.test.TestAc.onClick(Trolo.java:66)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at android.view.View.performClick(View.java:2364)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at android.view.View.onTouchEvent(View.java:4179)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at android.view.View.dispatchTouchEvent(View.java:3709)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at android.os.Handler.dispatchMessage(Handler.java:99)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at android.os.Looper.loop(Looper.java:123)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at android.app.ActivityThread.main(ActivityThread.java:4363)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at java.lang.reflect.Method.invokeNative(Native Method)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at java.lang.reflect.Method.invoke(Method.java:521)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
03-02 21:37:52.393: E/AndroidRuntime(1344):     at dalvik.system.NativeStart.main(Native Method)
03-02 21:37:52.413: I/dalvikvm(1344): threadid=7: reacting to signal 3
03-02 21:37:52.413: E/dalvikvm(1344): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
</code></pre>
