Stay organized with collections
Save and categorize content based on your preferences.
BluetoothProfile.ServiceListener
public
static
interface
BluetoothProfile.ServiceListener
android.bluetooth.BluetoothProfile.ServiceListener
|
An interface for notifying BluetoothProfile IPC clients when they have been connected or
disconnected to the service.
Summary
Public methods |
abstract
void
|
onServiceConnected(int profile, BluetoothProfile proxy)
Called to notify the client when the proxy object has been connected to the service.
|
abstract
void
|
onServiceDisconnected(int profile)
Called to notify the client that this proxy object has been disconnected from the
service.
|
Public methods
onServiceConnected
public abstract void onServiceConnected (int profile,
BluetoothProfile proxy)
Called to notify the client when the proxy object has been connected to the service.
onServiceDisconnected
public abstract void onServiceDisconnected (int profile)
Called to notify the client that this proxy object has been disconnected from the
service.
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,["# BluetoothProfile.ServiceListener\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nBluetoothProfile.ServiceListener\n================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/bluetooth/BluetoothProfile.ServiceListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nBluetoothProfile.ServiceListener\n`\n\n\n`\n\n\n`\n\n|----------------------------------------------------|\n| android.bluetooth.BluetoothProfile.ServiceListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nAn interface for notifying BluetoothProfile IPC clients when they have been connected or\ndisconnected to the service.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onServiceConnected](/reference/android/bluetooth/BluetoothProfile.ServiceListener#onServiceConnected(int,%20android.bluetooth.BluetoothProfile))`(int profile, `[BluetoothProfile](/reference/android/bluetooth/BluetoothProfile)` proxy) ` Called to notify the client when the proxy object has been connected to the service. |\n| ` abstract void` | ` `[onServiceDisconnected](/reference/android/bluetooth/BluetoothProfile.ServiceListener#onServiceDisconnected(int))`(int profile) ` Called to notify the client that this proxy object has been disconnected from the service. |\n\nPublic methods\n--------------\n\n### onServiceConnected\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onServiceConnected (int profile, \n BluetoothProfile proxy)\n```\n\nCalled to notify the client when the proxy object has been connected to the service.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `profile` | `int`: - One of [BluetoothProfile.HEADSET](/reference/android/bluetooth/BluetoothProfile#HEADSET) or [BluetoothProfile.A2DP](/reference/android/bluetooth/BluetoothProfile#A2DP) \u003cbr /\u003e |\n| `proxy` | `BluetoothProfile`: - One of [BluetoothHeadset](/reference/android/bluetooth/BluetoothHeadset) or [BluetoothA2dp](/reference/android/bluetooth/BluetoothA2dp) \u003cbr /\u003e |\n\n### onServiceDisconnected\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onServiceDisconnected (int profile)\n```\n\nCalled to notify the client that this proxy object has been disconnected from the\nservice.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `profile` | `int`: - One of [BluetoothProfile.HEADSET](/reference/android/bluetooth/BluetoothProfile#HEADSET) or [BluetoothProfile.A2DP](/reference/android/bluetooth/BluetoothProfile#A2DP) \u003cbr /\u003e |"]]