In Android 7.0 and higher, devices can display multiple apps simultaneously using multi-window. Android supports three multi-window configurations:
- Freeform: Lets users dynamically resize activity panes and have more than two apps visible on their screen. For desktop windowing, users can create freeform windows on a desktop that offers desktop-style interactions.
- Split screen: The default multi-window implementation, which provides two activity panes where users can place apps.
- Picture-in-picture (PiP): Lets devices that run Android play video content in a small window while the user interacts with other apps.
Multi-window device requirements
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.
Freeform
Freeform windowing lets the user create windows that are freely resizeable. Freeform windowing is a prerequisite for desktop windowing. The device requirements for enabling freeform windowing are as follows:
-
Enable the
config_supportsMultiWindowflag. -
Enable freeform window management in one of the following ways:
-
Enable the
config_freeformWindowManagementflag inconfig.xml:<feature name="android.software.freeform_window_management" /> -
Include the following in the device makefile:
PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.software.freeform_window_management.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/android.software.freeform_window_management.xml
-
Enable the
In Android 16, OEMs can support desktop windowing on their device for a freeform multi-window configuration using Enable desktop windowing.
Desktop windowing
Desktop windowing provides a workspace for multitasking on large screens, built on top of freeform windows. The workspace exists alongside fullscreen, with additional UI affordances and behaviors that give the user a more flexible multitasking experience:
- Keyboard or mouse interaction: Supports both touch-first and keyboard or mouse-first interactions.
- Freeform windows: Runs apps in resizable, movable windows with window caption bars and controls.
- Enhanced taskbar: Provides easy access to running and pinned apps.
- Optimization of external displays: Transforms connected monitors into desktop environments for supported devices.
- Virtual desks: Lets users organize apps across multiple workspaces.
Meet the following prerequisites to configure a device for desktop windowing:
-
Enable the following flags:
- All prerequisites for Freeform windowing
- The global desktop windowing flag
config_isDesktopModeSupported
- System UI requires a display that's at least 600 dp wide. Desktop windowing might not work as expected on smaller screens.
-
The device mustn't be a low-RAM device.
ActivityManager.isLowRammust returnfalse, as low-RAM devices aren't eligible for any multi-windowing features.
The following table lists the configurations in which a device can be configured for desktop windowing, depending on the screen size and how the device is intended to be used:
| Mode | Fullscreen-only handheld | Fullscreen-first handheld projecting to connected display | Fullscreen-first large screen extending to connected display | Desktop windowing-first large screen |
|---|---|---|---|---|
| Example form factor | Handheld phone | Handheld phone that supports HDMI to external display | Tablet that supports HDMI to external display | Tablet with keyboard that supports HDMI to external display |
| Internal display experience | Fullscreen, split screen, PiP, non-desktop freeform supported | Fullscreen, split screen, PiP supported | Fullscreen, split screen, PiP supported desktop windowing through separate desks | Desktop windowing is the default windowing mode (separate desks supported); users can enter fullscreen or touch mode desktop windowing through separate desks |
| Connected display experience | Mirroring internal display only | Desktop windowing only on connected displays | Desktop windowing extends desks; available on internal displays | Desktop windowing extends desks; available on internal displays |
| Config settings | ||||
config_supportsMultiWindow |
true |
true |
true |
true |
config_freeformWindowManagement |
true |
true |
true |
true |
config_isDesktopModeSupported |
false |
true |
true |
true |
config_canInternalDisplayHostDesktops |
Ignored | false |
true |
true |
config_enterDesktopByDefaultOnFreeformDisplay |
Ignored | false |
false |
true |
config_isDesktopModeSupported
The config overlay flag config_isDesktopModeSupported is the top-level flag for
enabling desktop windowing. If it's not enabled, all other config settings are ignored.
Set it to true in config.xml:
<!-- Globally enable Desktop windowing logic -->
<bool name="config_isDesktopModeSupported">true</bool>
When config_isDesktopModeSupported is true, the system automatically
treats eligible external displays (such as those connected by DisplayPort or HDMI) as
candidates for desktop windowing.
The display must be considered eligible by the Window Manager (at least public and trusted,
see Desktop windowing).
The system attempts to launch tasks in freeform mode on these displays by default.
config_canInternalDisplayHostDesktops
The config overlay flag config_canInternalDisplayHostDesktops enables desktop
windowing on the internal display of the device. Set it to true in
config.xml:
<!-- Allow the primary internal display to host desktop sessions -->
<bool name="config_canInternalDisplayHostDesktops">true</bool>Desktop windowing works best on a large-screen device like a tablet, compared to a smaller handheld phone. If not enabled, desktop windowing is supported only on an external display (assuming the device supports HDMI).
config_enterDesktopByDefaultOnFreeformDisplay
The config overlay flag config_enterDesktopByDefaultOnFreeformDisplay sets
desktop windowing as the default windowing mode on the internal display of the
device. If not enabled, fullscreen is the default windowing mode, with the desks
co-existing. Set it to true in config.xml:
<!-- Enable Desktop windowing as the default windowing mode on the internal display -->
<bool name="config_enterDesktopByDefaultOnFreeformDisplay">true</bool>Enable task limits
To configure the maximum number of tasks supported in desktop windowing, set the
config overlay flag config_maxDesktopWindowingActiveTasks in config.xml
to the maximum number of supported tasks. To support an unlimited number of tasks, set the
flag value to 0:
<!-- Maximum number of tasks supported in desktop windowing -->
<integer name="config_maxDesktopWindowingActiveTasks">4</integer>Enable desk limits
To configure the maximum number of virtual desks supported in desktop windowing, set the
config overlay flag config_maxDesktopWindowingDesks in config.xml
to the maximum number of supported desks. To support an unlimited number of desks, set the
flag value to 0:
<!-- Maximum number of virtual desks supported in desktop windowing -->
<integer name="config_maxDesktopWindowingDesks">4</integer>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.
Picture-in-picture
After enabling multi-window mode with the
config_supportsMultiWindow flag, device manufacturers can
support
picture-in-picture, which lets users watch
video while browsing other activities. While this feature is targeted at
Android TV devices, other device types might 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 Picture-in-picture.
System UI
Support all standard System UIs according to Multi-window mode verification.
Apps
To support multi-window mode for preloaded apps, see Support multi-window mode.
Validation
To validate your implementation of multi-window, run the related CTS tests and follow Multi-window mode verification.