Support multi-window

In Android 7.0 and higher, devices can display multiple apps simultaneously using multi-window. Android supports three multi-window configurations:

  • Split-screen is the default multi-window implementation, which provides two activity panes where users can place apps.
  • Freeform allows users to dynamically resize the activity panes and have more than two apps visible on their screen.
  • Picture-in-picture (PIP) allows Android devices to play video content in a small window while the user interacts with other apps.

Implementation

Multi-window support is enabled by default in Android 7.0 and higher. To disable it, set the config_supportsMultiWindow flag to false in your device's config.xml file.

Multi-window is disabled by default on all low-RAM devices (devices that declare ActivityManager.isLowRam()). Low-RAM devices ignore the value of the config_supportsMultiWindow flag.

Split-screen

Multi-window's default experience is split-screen mode, where the System UI is divided down the middle of the device in portrait or landscape. Users can resize the window by dragging the dividing line side to side or top to bottom, depending on the device orientation.

After enabling split-screen, device manufacturers can choose to enable freeform or PIP.

Android 8.0 and higher improves split-screen by compressing the launcher when the user taps Home. For implementation details, see Split-screen interactions.

Freeform

After enabling multi-window mode with the config_supportsMultiWindow flag, device manufacturers can allow freeform windowing. This mode is most useful on larger devices, such as tablets.

To support freeform mode, enable the PackageManager#FEATURE_FREEFORM_WINDOW_MANAGEMENT system feature in /android/frameworks/base/core/java/android/content/pm/PackageManager.java and set config_freeformWindowManagement to true in config.xml.

    <bool name="config_freeformWindowManagement">true</bool>
    

Picture-in-picture

After enabling multi-window mode with the config_supportsMultiWindow flag, device manufacturers can support picture-in-picture, which allows users to watch video while browsing other activities. While this feature is targeted at Android Television devices, other device types may support this feature.

To support PIP, enable the PackageManager#FEATURE_PICTURE_IN_PICTURE system feature in /android/frameworks/base/core/java/android/content/pm/PackageManager.java.

For more PIP implementation details for devices running Android 8.0 and higher,see the Picture-in-picture page.

System UI

Support all standard System UIs according to Multi-window developer documentation.

Apps

To support multi-window mode for preloaded apps, consult the Android developer documentation.

Validation

To validate your implementation of multi-window, run the related CTS tests and follow the testing instructions for multi-window.

For Android 7.0, the tests are in /platform/cts/hostsidetests/services/activitymanager/src/android/server/cts. In Android 8.0 and higher, the tests are in /platform/cts/tests/framework/base/activitymanager/src/android/server/am.