This is one of the few places where using android:configChanges in the manifest, and onConfigurationChanged() in the code, is justified. Your activity is being destroyed and recreated, and it will interrupt the user experience to have to rebuffer the video and skip ahead to wherever they were before.
On Tue, Apr 26, 2011 at 6:06 AM, gaurav <[email protected]> wrote: > Hi, > I am trying to play a video from URL, it is working fine but whenever > i am changing the orientation of my mobile it is reset and starts > playing all over again and even reset the already buffered data. Here > is my code > > super.onCreate(icicle); > getWindow().setFormat(PixelFormat.TRANSLUCENT); > setContentView(R.layout.main); > > video = (VideoView)findViewById(R.id.video); > video.setVideoURI(uri); > ctlr = new MediaController(this); > ctlr.setMediaPlayer(video); > video.setMediaController(ctlr); > video.requestFocus(); > video.start(); > > Thanks :) > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

