The way to rotate the screen is with the window manager APIs (which
will be changing in an upcoming SDK, fwiw).  It wouldn't make sense to
have an API to rotate the emulator skin, because you can't really make
the person holding the device to turn it in their hand. :)

On Apr 14, 10:34 am, Cheryl Sedota <[EMAIL PROTECTED]> wrote:
> This works beautifully, thanks Dianne!  One additional question -
> we've found that we can also press the '9' key to rotate the entire
> emulator window 90 degrees so that the user can view the device as it
> would be seen had the user physically rotated it - is there a way for
> us to invoke that rotation programatically too?
>
> Thanks
> Cheryl
>
> On Mar 28, 8:15 pm, hackbod <[EMAIL PROTECTED]> wrote:
>
> > To add a little -- most of the orientation work is in M5, though there
> > is still some to be done.  Some initial docs are here:
>
> >http://code.google.com/android/reference/android/app/Activity.html#Co...
>
> > On Mar 28, 2:35 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > >   Hi,
>
> > >   You can change the current orientation of the window by using the
> > > WindowManager.LayoutParams class. This class provides the following flags:
>
> > > int  
> > > FLAG_ORIENTATION_DEFAULT<http://code.google.com/android/reference/android/view/WindowManager.L...>
> > >   Windowflag: Force the display to the user's current orientation setting,
> > > regardless of the windows behind it.  12288  0x00003000   int
> > > FLAG_ORIENTATION_LANDSCAPE<http://code.google.com/android/reference/android/view/WindowManager.L...>
> > >   Windowflag: The display must be in a landscape orientation when this
> > > window is at the top.  8192  0x00002000   int
> > > FLAG_ORIENTATION_PORTRAIT<http://code.google.com/android/reference/android/view/WindowManager.L...>
> > >   Windowflag: The display must be in a portrait orientation when this
> > > window is at the top.  4096  0x00001000
>
> > > Get your  current Activity's  Window object and set the flags above to
> > > change orientation of the window:
>
> > >    getWindow().setFlags(
> > >                     WindowManager.LayoutParams.FLAG_ORIENTATION_PORTRAIT,
> > >                     WindowManager.LayoutParams.FLAG_ORIENTATION_DEFAULT);
> > >    or
>
> > >    getWindow().setFlags(
> > >                     WindowManager.LayoutParams.FLAG_ORIENTATION_LANDSCAPE,
> > >                     WindowManager.LayoutParams.FLAG_ORIENTATION_DEFAULT);
>
> > > When you change the orientation, it is a configuration change which will
> > > cause your current activity to be *destroyed*, you may want to bypass
> > > restarting
> > > of your activity by setting
> > > android:configChanges<http://code.google.com/android/reference/android/R.attr.html#configCh...>attribute
> > > in its manifest as follows:
>
> > >   <activity android:name=".OrientationTest" 
> > > android:label="OrientationTest"
> > >         android:configChanges="orientation">
> > >             <intent-filter>
> > >               ...
> > >             </intent-filter>
> > >    </activity>
>
> > > More details on this are under the "Configuration Changes" section in the
> > > link 
> > > below:http://code.google.com/android/reference/android/app/Activity.html
>
> > > Thanks,
> > > Megha
>
> > > On Fri, Mar 28, 2008 at 1:03 PM, CJ <[EMAIL PROTECTED]> wrote:
>
> > > > Hi, guys
> > > > I saw this statement in the forum which was posted in Jan08
> > > > *quote: The current SDK doesn't have complete support for
> > > > orientations, and definitely not orientation switching while running.
> > > > *
> > > > First of all, is it still true?
> > > > Also, can anybody give a reference?
> > > > Thanks
> > > > CJ
--~--~---------~--~----~------------~-------~--~----~
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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to