Monday, April 26, 2010

Re: [android-developers] preventing orientation change during video playback

Hi Abhi,

You need to do 2 things:

1) Add android:configChanges="orientation" to the activity declaration on your manifest file. Something like this:
        <activity android:name="activity"
...

                     android:configChanges="orientation">
 

2) Override method onConfigurationChanged() in your activity. To learn more: http://developer.android.com/reference/android/app/Activity.html#onConfigurationChanged(android.content.res.Configuration)


Felipe Silveira
felipesilveira.com.br

On Mon, Apr 26, 2010 at 12:31 PM, Abhi <abhishek.r.sharma@gmail.com> wrote:
hello

I am workin on a video player app in which I want only the landscape
orientation active coz right now when the user tilts the phone during
video runtime, it restarts playback in that orientation.

How can I easily avoid this?

Thanks,

Abhi

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en



--
Felipe Silveira
http://www.felipesilveira.com.br            
-------------------------------------------------

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment