Media Player Problem

Posted by kostas_menu on Stack Overflow See other posts from Stack Overflow or by kostas_menu
Published on 2010-12-26T20:51:25Z Indexed on 2010/12/26 20:54 UTC
Read the original article Hit count: 160

Filed under:
   button.setOnClickListener(new View.OnClickListener() {  

    public void onClick(View v){
               if(mp2.isPlaying()==true)
                       {mp2.stop();
                        mp.start();

                       }
               else
               mp.start(); 


           }      

        });         


        button2.setOnClickListener(new View.OnClickListener() {   

            public void onClick(View v){
                if(mp.isPlaying()==true)
                {mp.stop();mp2.start();}
                else
               mp2.start(); 

           }  

        });   

I press the first btn and the 1st song is playing.i press the second,the first stops and the second begins.But then, as i press the first btn, the second song stops but the first song is not playing...please help!!:)

© Stack Overflow or respective owner

Related posts about android