Skip to content

Most visited

Recently visited

navigation

DisplayManagerCompat

public abstract class DisplayManagerCompat
extends Object

java.lang.Object
   ↳ android.support.v4.hardware.display.DisplayManagerCompat


Helper for accessing features in DisplayManager introduced after API level 4 in a backwards compatible fashion.

Summary

Constants

String DISPLAY_CATEGORY_PRESENTATION

Display category: Presentation displays.

Public methods

abstract Display getDisplay(int displayId)

Gets information about a logical display.

abstract Display[] getDisplays()

Gets all currently valid logical displays.

abstract Display[] getDisplays(String category)

Gets all currently valid logical displays of the specified category.

static DisplayManagerCompat getInstance(Context context)

Gets an instance of the display manager given the context.

Inherited methods

From class java.lang.Object

Constants

DISPLAY_CATEGORY_PRESENTATION

String DISPLAY_CATEGORY_PRESENTATION

Display category: Presentation displays.

This category can be used to identify secondary displays that are suitable for use as presentation displays.

See also:

Constant Value: "android.hardware.display.category.PRESENTATION"

Public methods

getDisplay

Display getDisplay (int displayId)

Gets information about a logical display. The display metrics may be adjusted to provide compatibility for legacy applications.

Parameters
displayId int: The logical display id.
Returns
Display The display object, or null if there is no valid display with the given id.

getDisplays

Display[] getDisplays ()

Gets all currently valid logical displays.

Returns
Display[] An array containing all displays.

getDisplays

Display[] getDisplays (String category)

Gets all currently valid logical displays of the specified category.

When there are multiple displays in a category the returned displays are sorted of preference. For example, if the requested category is DISPLAY_CATEGORY_PRESENTATION and there are multiple presentation displays then the displays are sorted so that the first display in the returned array is the most preferred presentation display. The application may simply use the first display or allow the user to choose.

Parameters
category String: The requested display category or null to return all displays.
Returns
Display[] An array containing all displays sorted by order of preference.

See also:

getInstance

DisplayManagerCompat getInstance (Context context)

Gets an instance of the display manager given the context.

Parameters
context Context
Returns
DisplayManagerCompat
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.