• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to show Activity when video is completed?

Ankit2502

Newbie
Hello Friends,
I am new in Android development & i am developing one application in which first activity play the video and when video is completed i want to show another acitviy. For this i have implemented OnCompletionListener and write this piece of code into VideoActivity which is responsible for playing video and after completion of video i want to launch MainActivity.
Code:
public void onCompletion(MediaPlayer media) {
		
     if (media != null) {
	 media.stop();
	 media.release();
     }
     Intent intent = new Intent(VideoActivity.this,MainActivity.class);
     startActivity(intent);
}

but i am getting Source Not Found error when i am debugging it...can you tell me what can i do for it.
 
Back
Top Bottom