Stay organized with collections
Save and categorize content based on your preferences.
public
static
interface
InputManager.InputDeviceListener
android.hardware.input.InputManager.InputDeviceListener
|
Listens for changes in input devices.
Summary
Public methods |
abstract
void
|
onInputDeviceAdded(int deviceId)
Called whenever an input device has been added to the system.
|
abstract
void
|
onInputDeviceChanged(int deviceId)
Called whenever the properties of an input device have changed since they
were last queried.
|
abstract
void
|
onInputDeviceRemoved(int deviceId)
Called whenever an input device has been removed from the system.
|
Public methods
public abstract void onInputDeviceAdded (int deviceId)
Called whenever an input device has been added to the system.
Use InputManager.getInputDevice(int)
to get more information about the device.
Parameters |
deviceId |
int : The id of the input device that was added. |
public abstract void onInputDeviceChanged (int deviceId)
Called whenever the properties of an input device have changed since they
were last queried. Use InputManager.getInputDevice
to get
a fresh InputDevice
object with the new properties.
Parameters |
deviceId |
int : The id of the input device that changed. |
public abstract void onInputDeviceRemoved (int deviceId)
Called whenever an input device has been removed from the system.
Parameters |
deviceId |
int : The id of the input device 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# InputManager.InputDeviceListener\n\nAdded in [API level 16](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nInputManager.InputDeviceListener\n================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/hardware/input/InputManager.InputDeviceListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nInputManager.InputDeviceListener\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------------------|\n| android.hardware.input.InputManager.InputDeviceListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nListens for changes in input devices.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onInputDeviceAdded](/reference/android/hardware/input/InputManager.InputDeviceListener#onInputDeviceAdded(int))`(int deviceId) ` Called whenever an input device has been added to the system. |\n| ` abstract void` | ` `[onInputDeviceChanged](/reference/android/hardware/input/InputManager.InputDeviceListener#onInputDeviceChanged(int))`(int deviceId) ` Called whenever the properties of an input device have changed since they were last queried. |\n| ` abstract void` | ` `[onInputDeviceRemoved](/reference/android/hardware/input/InputManager.InputDeviceListener#onInputDeviceRemoved(int))`(int deviceId) ` Called whenever an input device has been removed from the system. |\n\nPublic methods\n--------------\n\n### onInputDeviceAdded\n\nAdded in [API level 16](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onInputDeviceAdded (int deviceId)\n```\n\nCalled whenever an input device has been added to the system.\nUse [InputManager.getInputDevice(int)](/reference/android/hardware/input/InputManager#getInputDevice(int)) to get more information about the device.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|----------------------------------------------------------|\n| `deviceId` | `int`: The id of the input device that was added. \u003cbr /\u003e |\n\n### onInputDeviceChanged\n\nAdded in [API level 16](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onInputDeviceChanged (int deviceId)\n```\n\nCalled whenever the properties of an input device have changed since they\nwere last queried. Use [InputManager.getInputDevice](/reference/android/hardware/input/InputManager#getInputDevice(int)) to get\na fresh [InputDevice](/reference/android/view/InputDevice) object with the new properties.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|--------------------------------------------------------|\n| `deviceId` | `int`: The id of the input device that changed. \u003cbr /\u003e |\n\n### onInputDeviceRemoved\n\nAdded in [API level 16](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onInputDeviceRemoved (int deviceId)\n```\n\nCalled whenever an input device has been removed from the system.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|------------------------------------------------------------|\n| `deviceId` | `int`: The id of the input device that was removed. \u003cbr /\u003e |"]]