I told my activity to go in landscape mode like so:
<activity
android:name="com.bob.Main_Activity"
android:label="@string/app_name"
android:screenOrientation="landscape" >
It works when I launch manually. However, when I config it to launch
at boot, it starts in portrait, then landscape.
For now, I'm using this kludge:
boolean is_portrait()
{
Display display = ((WindowManager)
getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
return (height > width);
}
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
…
if (is_portrait())
return;
Is there a better way to make it not start in portrait mode on boot?
--
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