开发者

Media Player Problem

开发者 https://www.devze.com 2023-02-01 01:18 出处:网络
button.setOnClickListener(new View.OnClickListener() { public void onClick(View v){ if(mp2.isPlaying()==true)
   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();}
  开发者_JS百科              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!!:)


You did not call prepare() (or prepareAsync()) and seekTo(0) on your original MediaPlayer to rewind it.

0

精彩评论

暂无评论...
验证码 换一张
取 消