Stay organized with collections
Save and categorize content based on your preferences.
DevicePickerLauncher
@RequiresApi(value = 26) interface DevicePickerLauncher
A launcher to start a device discovery and show a dialog chooser to display available devices.
Summary
Public functions
launchDevicePicker
suspend fun launchDevicePicker(
deviceFilters: List<DeviceFilter>,
startComponentRequest: StartComponentRequest
): Unit
Launches a dialog chooser for available devices.
Parameters |
deviceFilters: List<DeviceFilter> |
Only devices that pass all filters will be shown to the user. Note: There are currently no DeviceFilters supported in this version, so callers must pass in an empty list.
|
startComponentRequest: StartComponentRequest |
A request indicating how the caller wants the Android component to be started on the receiving device.
|
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,["# DevicePickerLauncher\n====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/com/google/ambient/crossdevice/discovery/DevicePickerLauncher \"View this page in Java\")\n\n\n```\n@RequiresApi(value = 26) interface DevicePickerLauncher\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA launcher to start a device discovery and show a dialog chooser to display available devices.\n\nSummary\n-------\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `suspend `[Unit](/reference/kotlin/kotlin/Unit) | [launchDevicePicker](/reference/kotlin/com/google/ambient/crossdevice/discovery/DevicePickerLauncher#launchDevicePicker(kotlin.collections.List,com.google.ambient.crossdevice.wakeup.StartComponentRequest))`(` ` deviceFilters: `[List](/reference/kotlin/kotlin/collections/List)`\u003c`[DeviceFilter](/reference/kotlin/com/google/ambient/crossdevice/discovery/DeviceFilter)`\u003e,` ` startComponentRequest: `[StartComponentRequest](/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest) `)` Launches a dialog chooser for available devices. |\n| [ListenableFuture](/reference/kotlin/com/google/common/util/concurrent/ListenableFuture)`\u003c`[Void](/reference/kotlin/java/lang/Void)`?\u003e` | [launchDevicePickerFuture](/reference/kotlin/com/google/ambient/crossdevice/discovery/DevicePickerLauncher#launchDevicePickerFuture(kotlin.collections.List,com.google.ambient.crossdevice.wakeup.StartComponentRequest))`(` ` deviceFilters: `[List](/reference/kotlin/kotlin/collections/List)`\u003c`[DeviceFilter](/reference/kotlin/com/google/ambient/crossdevice/discovery/DeviceFilter)`\u003e,` ` startComponentRequest: `[StartComponentRequest](/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest) `)` Java-compatible version of [launchDevicePicker](/reference/kotlin/com/google/ambient/crossdevice/discovery/DevicePickerLauncher#launchDevicePicker(kotlin.collections.List,com.google.ambient.crossdevice.wakeup.StartComponentRequest)). |\n\nPublic functions\n----------------\n\n### launchDevicePicker\n\n```\nsuspend fun launchDevicePicker(\n deviceFilters: List\u003cDeviceFilter\u003e,\n startComponentRequest: StartComponentRequest\n): Unit\n```\n\nLaunches a dialog chooser for available devices. \n\n| Parameters ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `deviceFilters: `[List](/reference/kotlin/kotlin/collections/List)`\u003c`[DeviceFilter](/reference/kotlin/com/google/ambient/crossdevice/discovery/DeviceFilter)`\u003e` | Only devices that pass all filters will be shown to the user. Note: There are currently no [DeviceFilters](/reference/kotlin/com/google/ambient/crossdevice/discovery/DeviceFilter) supported in this version, so callers must pass in an empty list. |\n| `startComponentRequest: `[StartComponentRequest](/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest) | A request indicating how the caller wants the Android component to be started on the receiving device. |\n\n### launchDevicePickerFuture\n\n```\nfun launchDevicePickerFuture(\n deviceFilters: List\u003cDeviceFilter\u003e,\n startComponentRequest: StartComponentRequest\n): ListenableFuture\u003cVoid?\u003e\n```\n\nJava-compatible version of [launchDevicePicker](/reference/kotlin/com/google/ambient/crossdevice/discovery/DevicePickerLauncher#launchDevicePicker(kotlin.collections.List,com.google.ambient.crossdevice.wakeup.StartComponentRequest))."]]