Pular para o conteúdo

Mais visitados

Visitados recentemente


Window management

This page describes the window manager on Chrome OS.

The window manager on Chrome OS

Android apps are grouped into the following categories:

API level Window manager behavior
Android 1.5 (API level 3) and earlier These apps are always shown full screen.
Android 1.6 (API level 6) through Android 6.0 (API level 23) These apps are treated as unsafe to be resized. If possible, these apps launch by default to a phone-sized portrait window; otherwise they launch into a phone-sized landscape window. The user can press F4 to enter or leave full screen mode which fully restarts the app—killing and starting the app anew—and keeps it from then on in full screen portrait-sized (or rotated into landscape).
Android 7.0 (API level 24) resizable This is the default for Android 7.0: apps are resizable without restarting. These apps start usually maximized by default. Chromebooks at version M60 and earlier start portrait sized windows by default in phone sized (Nexus 5X) portrait.
Android 7.0 (API level 24) un-resizable An application specifies android:resizeableActivity="false" and it avoids being resized. However, there are some situations that require a resize, such as when the user changes the screen size, the activity is on top of a resizable activity, or the activity changes the orientation.
Android 7.0 (API level 24) app-controlled The app requests a special launch size.

Note that app states like maximized or bound are remembered.

The root activity rules

A window on Chromebooks consists of a stack of activity windows. Each window in this stack has the same size and orientation.

To avoid sudden orientation and size changes—which are confusing for the user in a desktop environment—the window manager on Chromebooks does the same as the window manager in Android when the side by side mode is used:

Device mode has an effect here: in tablet mode the orientation is not locked and each orientation dictates its own orientation as it is normal on Android. However, the app size locks, if the activity targets Android 6.0 (API level 23) or lower.


The most common orientation is portrait as phones are mostly held this way. This mode is good for phones, but terrible for laptops. On the other hand, landscape is good for laptops and good for tablets. To get the best results for your application with a window manager, you should consider supporting both orientations.

Some Android apps assume that when a device is held in the portrait mode, the rotation value is always Surface.ROTATION_0. This may be true for most Android devices. However, when the app is in a certain ARC mode, the rotation value for the portrait orientation may not be Surface.ROTATION_0.

To get an accurate rotation value while reading the accelerometer or similar sensors, use the Display.getRotation() method and swap the axis accordingly. For more information on setting the orientation, download the AccelerometerPlay sample app.

If you support only one, add the information to the manifest so that the window manager knows about this before starting the application. When specifying an orientation, make sure that you specify sensor orientations when possible as Chromebooks are often convertibles and upside down apps are annoying. Please do stick with a selected orientation - and most important of all: Avoid requesting one orientation in the manifest and then set another programmatically later. If you change the orientation based on window size, you might get stuck in a small portrait size window, and the user cannot get back into a big landscape window.

Launch size

Apps can change their launch size by using one of the following ways:

Full screen

This works the same way as on stock Android: If the window is not covering the full screen, requests for full screening (hiding all system-UI) are ignored. When the app is maximized the normal methods / layouts / functions to get into fullscreen mode apply. This way the system UI (window control bar and the shelf) goes away.

Este site usa cookies para armazenar suas preferências quanto às opções de idioma e exibição específicas ao site.

Receba as dicas e notícias mais recentes para desenvolvedores Android que ajudarão você a ter sucesso no Google Play.

* Campos obrigatórios


Siga o Google Developers no WeChat

Navegar neste site em ?

Você solicitou uma página em , mas sua preferência de idioma para este site está definida como .

Quer alterar sua preferência de idioma e navegar neste site em ? Para alterar a preferência de idioma depois, use o menu de idiomas na parte inferior de cada página.

É preciso ter o nível de API ou superior para esta aula

Este documento está oculto porque o nível de API selecionado para a documentação é o . Para alterar o nível, clique no seletor acima da barra de navegação esquerda.

Para mais informações sobre como especificar o nível de API que o seu app precisa, leia o artigo Compatibilidade com diferentes versões de plataforma.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)