Stay organized with collections
Save and categorize content based on your preferences.
DeviceCallback
class DeviceCallback
Callback class used for clients to receive MIDI device added and removed notifications
Summary
Public methods |
open Unit |
Called to notify when a new MIDI device has been added
|
open Unit |
Called to notify when a MIDI device has been removed
|
open Unit |
Called to notify when the status of a MIDI device has changed
|
Public constructors
DeviceCallback
DeviceCallback()
Public methods
onDeviceAdded
open fun onDeviceAdded(device: MidiDeviceInfo!): Unit
Called to notify when a new MIDI device has been added
onDeviceRemoved
open fun onDeviceRemoved(device: MidiDeviceInfo!): Unit
Called to notify when a MIDI device has been removed
onDeviceStatusChanged
open fun onDeviceStatusChanged(status: MidiDeviceStatus!): Unit
Called to notify when the status of a MIDI device has changed
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,["# MidiManager.DeviceCallback\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDeviceCallback\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/midi/MidiManager.DeviceCallback \"View this page in Java\") \n\n```\nclass DeviceCallback\n```\n\n|---|----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.midi.MidiManager.DeviceCallback](#) |\n\nCallback class used for clients to receive MIDI device added and removed notifications\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------|---|\n| [DeviceCallback](#DeviceCallback())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onDeviceAdded](#onDeviceAdded(android.media.midi.MidiDeviceInfo))`(`device:` `[MidiDeviceInfo](/reference/kotlin/android/media/midi/MidiDeviceInfo)!`)` Called to notify when a new MIDI device has been added |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onDeviceRemoved](#onDeviceRemoved(android.media.midi.MidiDeviceInfo))`(`device:` `[MidiDeviceInfo](/reference/kotlin/android/media/midi/MidiDeviceInfo)!`)` Called to notify when a MIDI device has been removed |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onDeviceStatusChanged](#onDeviceStatusChanged(android.media.midi.MidiDeviceStatus))`(`status:` `[MidiDeviceStatus](/reference/kotlin/android/media/midi/MidiDeviceStatus)!`)` Called to notify when the status of a MIDI device has changed |\n\nPublic constructors\n-------------------\n\n### DeviceCallback\n\n```\nDeviceCallback()\n```\n\nPublic methods\n--------------\n\n### onDeviceAdded\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onDeviceAdded(device: MidiDeviceInfo!): Unit\n```\n\nCalled to notify when a new MIDI device has been added\n\n| Parameters ||\n|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `device` | [MidiDeviceInfo](/reference/kotlin/android/media/midi/MidiDeviceInfo)!: a [MidiDeviceInfo](/reference/kotlin/android/media/midi/MidiDeviceInfo) for the newly added device |\n\n### onDeviceRemoved\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onDeviceRemoved(device: MidiDeviceInfo!): Unit\n```\n\nCalled to notify when a MIDI device has been removed\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `device` | [MidiDeviceInfo](/reference/kotlin/android/media/midi/MidiDeviceInfo)!: a [MidiDeviceInfo](/reference/kotlin/android/media/midi/MidiDeviceInfo) for the removed device |\n\n### onDeviceStatusChanged\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onDeviceStatusChanged(status: MidiDeviceStatus!): Unit\n```\n\nCalled to notify when the status of a MIDI device has changed\n\n| Parameters ||\n|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `status` | [MidiDeviceStatus](/reference/kotlin/android/media/midi/MidiDeviceStatus)!: a [MidiDeviceStatus](/reference/kotlin/android/media/midi/MidiDeviceStatus) for the changed device |"]]