Log in or register to post comments

video play application exit after press back button

April 20, 2012 - 8:30pm #1

Hi,

I able to play a video where video file stored in .apk. Video successfully play after detect the marker but the problem is after play the video, when I press back button it exit the application. where it should be again come to video capturing mode after press back button. Can any one help me.

setContentView(R.layout.main);
VideoView vd = (VideoView) findViewById(R.id.VideoView);
Uri uri = Uri.parse("android.resource://"+getPackageName() + "/"+R.raw.intro1);
mc = new MediaController(this);
vd.setMediaController(mc);
vd.setVideoURI(uri);
vd.start();

Can any one help me.

Regards

Rassall

Re: video play application exit after press back button

May 14, 2012 - 5:20pm #3

Rassal, can you help me, I need to play a video inside a plane object. how's the video format. and script for that.

Re: video play application exit after press back button

April 23, 2012 - 4:49am #2

It looks like you're not starting a new activity when playing video so the correct behaviour is to exit the current activity and hence exit the application.

Try overriding the onbackpressed() function and closing the VideoView stuff in there.

Log in or register to post comments