Stay organized with collections
Save and categorize content based on your preferences.
DisplayManager.DisplayListener
public
static
interface
DisplayManager.DisplayListener
android.hardware.display.DisplayManager.DisplayListener
|
Listens for changes in available display devices.
Summary
Public methods |
abstract
void
|
onDisplayAdded(int displayId)
Called whenever a logical display has been added to the system.
|
abstract
void
|
onDisplayChanged(int displayId)
Called whenever the properties of a logical Display ,
such as size and density, have changed.
|
abstract
void
|
onDisplayRemoved(int displayId)
Called whenever a logical display has been removed from the system.
|
Public methods
onDisplayAdded
public abstract void onDisplayAdded (int displayId)
Called whenever a logical display has been added to the system.
Use DisplayManager.getDisplay
to get more information about
the display.
Parameters |
displayId |
int : The id of the logical display that was added. |
onDisplayChanged
public abstract void onDisplayChanged (int displayId)
Called whenever the properties of a logical Display
,
such as size and density, have changed.
Parameters |
displayId |
int : The id of the logical display that changed. |
onDisplayRemoved
public abstract void onDisplayRemoved (int displayId)
Called whenever a logical display has been removed from the system.
Parameters |
displayId |
int : The id of the logical display that was removed. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# DisplayManager.DisplayListener\n\nAdded in [API level 17](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nDisplayManager.DisplayListener\n==============================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/hardware/display/DisplayManager.DisplayListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nDisplayManager.DisplayListener\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------------------|\n| android.hardware.display.DisplayManager.DisplayListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nListens for changes in available display devices.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onDisplayAdded](/reference/android/hardware/display/DisplayManager.DisplayListener#onDisplayAdded(int))`(int displayId) ` Called whenever a logical display has been added to the system. |\n| ` abstract void` | ` `[onDisplayChanged](/reference/android/hardware/display/DisplayManager.DisplayListener#onDisplayChanged(int))`(int displayId) ` Called whenever the properties of a logical [Display](/reference/android/view/Display), such as size and density, have changed. |\n| ` abstract void` | ` `[onDisplayRemoved](/reference/android/hardware/display/DisplayManager.DisplayListener#onDisplayRemoved(int))`(int displayId) ` Called whenever a logical display has been removed from the system. |\n\nPublic methods\n--------------\n\n### onDisplayAdded\n\nAdded in [API level 17](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onDisplayAdded (int displayId)\n```\n\nCalled whenever a logical display has been added to the system.\nUse [DisplayManager.getDisplay](/reference/android/hardware/display/DisplayManager#getDisplay(int)) to get more information about\nthe display.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|-------------------------------------------------------------|\n| `displayId` | `int`: The id of the logical display that was added. \u003cbr /\u003e |\n\n### onDisplayChanged\n\nAdded in [API level 17](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onDisplayChanged (int displayId)\n```\n\nCalled whenever the properties of a logical [Display](/reference/android/view/Display),\nsuch as size and density, have changed.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|-----------------------------------------------------------|\n| `displayId` | `int`: The id of the logical display that changed. \u003cbr /\u003e |\n\n### onDisplayRemoved\n\nAdded in [API level 17](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onDisplayRemoved (int displayId)\n```\n\nCalled whenever a logical display has been removed from the system.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|---------------------------------------------------------------|\n| `displayId` | `int`: The id of the logical display that was removed. \u003cbr /\u003e |"]]