Calling another activity when mediaplayer get finished playing?

MPlayer. SetOnCompletionListener(new OnCompletionListener() { Override public void onCompletion(MediaPlayer arg0) { Intent stopplay=new Intent(MyRecording. This,Recorded_Message.

Class); startActivity(stopplay); } }).

MPlayer. SetOnCompletionListener(new OnCompletionListener() { @Override public void onCompletion(MediaPlayer arg0) { Intent stopplay=new Intent(MyRecording. This,Recorded_Message.

Class); startActivity(stopplay); } }).

I'll try to explain what is wrong in your code. OnCreate calls only one time when an Activity creates. So, in your code you set a source for your mPlayer: mPlayer.

SetDataSource(mFileName); then prepare it: mPlayer.prepare(); and then starts playing: mPlayer.start(); As you just started mPlayer, of cource if statment will be false and the code in if will never be performed: if(mPlayer. GetCurrentPosition()== mPlayer.getDuration()) { Intent stopplay=new Intent(MyRecording. This,Recorded_Message.

Class); startActivity(stopplay); } I remind you that onCreate is called only once. So, use event as described above.

Thanks a lot guys.. – Jack Sparrow May 14 at 12:15.

OnCreate calls only one time when an Activity creates. Intent stopplay=new Intent(MyRecording. I remind you that onCreate is called only once.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions