Stay organized with collections
Save and categorize content based on your preferences.
ResolveListener
interface ResolveListener
Callback for use with android.net.nsd.NsdManager#resolveService to resolve the service info and use with NsdManager.stopServiceResolution
to stop resolution.
Summary
Public methods |
open Unit |
Called on the internal thread or with an executor passed to android.
|
abstract Unit |
Called on the internal thread or with an executor passed to android.
|
abstract Unit |
Called on the internal thread or with an executor passed to android.
|
open Unit |
Called once on the internal thread or with an executor passed to android.
|
Public methods
onResolutionStopped
open fun onResolutionStopped(serviceInfo: NsdServiceInfo): Unit
Called on the internal thread or with an executor passed to android.net.nsd.NsdManager#resolveService to report the resolution was stopped. A stop resolution operation would call either onResolutionStopped or onStopResolutionFailed once based on the result.
onResolveFailed
abstract fun onResolveFailed(
serviceInfo: NsdServiceInfo!,
errorCode: Int
): Unit
Called on the internal thread or with an executor passed to android.net.nsd.NsdManager#resolveService to report the resolution was failed with an error. A resolution operation would call either onServiceResolved or onResolveFailed once based on the result.
onServiceResolved
abstract fun onServiceResolved(serviceInfo: NsdServiceInfo!): Unit
Called on the internal thread or with an executor passed to android.net.nsd.NsdManager#resolveService to report the resolved service info. A resolution operation would call either onServiceResolved or onResolveFailed once based on the result.
onStopResolutionFailed
open fun onStopResolutionFailed(
serviceInfo: NsdServiceInfo,
errorCode: Int
): Unit
Called once on the internal thread or with an executor passed to android.net.nsd.NsdManager#resolveService to report that stopping resolution failed with an error. A stop resolution operation would call either onResolutionStopped or onStopResolutionFailed once based on the result.
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,["# NsdManager.ResolveListener\n\nAdded in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nResolveListener\n===============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/nsd/NsdManager.ResolveListener \"View this page in Java\") \n\n```\ninterface ResolveListener\n```\n\n|-------------------------------------------------|\n| [android.net.nsd.NsdManager.ResolveListener](#) |\n\nCallback for use with android.net.nsd.NsdManager#resolveService to resolve the service info and use with [NsdManager.stopServiceResolution](/reference/kotlin/android/net/nsd/NsdManager#stopServiceResolution(android.net.nsd.NsdManager.ResolveListener)) to stop resolution.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onResolutionStopped](#onResolutionStopped(android.net.nsd.NsdServiceInfo))`(`serviceInfo:` `[NsdServiceInfo](/reference/kotlin/android/net/nsd/NsdServiceInfo)`)` Called on the internal thread or with an executor passed to android. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onResolveFailed](#onResolveFailed(android.net.nsd.NsdServiceInfo,%20kotlin.Int))`(`serviceInfo:` `[NsdServiceInfo](/reference/kotlin/android/net/nsd/NsdServiceInfo)!`, `errorCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called on the internal thread or with an executor passed to android. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onServiceResolved](#onServiceResolved(android.net.nsd.NsdServiceInfo))`(`serviceInfo:` `[NsdServiceInfo](/reference/kotlin/android/net/nsd/NsdServiceInfo)!`)` Called on the internal thread or with an executor passed to android. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStopResolutionFailed](#onStopResolutionFailed(android.net.nsd.NsdServiceInfo,%20kotlin.Int))`(`serviceInfo:` `[NsdServiceInfo](/reference/kotlin/android/net/nsd/NsdServiceInfo)`, `errorCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called once on the internal thread or with an executor passed to android. |\n\nPublic methods\n--------------\n\n### onResolutionStopped\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [T Extensions 7](https://developer.android.com/sdkExtensions) \n\n```\nopen fun onResolutionStopped(serviceInfo: NsdServiceInfo): Unit\n```\n\nCalled on the internal thread or with an executor passed to android.net.nsd.NsdManager#resolveService to report the resolution was stopped. A stop resolution operation would call either onResolutionStopped or onStopResolutionFailed once based on the result.\n\n| Parameters ||\n|---------------|--------------------------------------------------------------------------------------------------|\n| `serviceInfo` | [NsdServiceInfo](/reference/kotlin/android/net/nsd/NsdServiceInfo): This value cannot be `null`. |\n\n### onResolveFailed\n\nAdded in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onResolveFailed(\n serviceInfo: NsdServiceInfo!, \n errorCode: Int\n): Unit\n```\n\nCalled on the internal thread or with an executor passed to android.net.nsd.NsdManager#resolveService to report the resolution was failed with an error. A resolution operation would call either onServiceResolved or onResolveFailed once based on the result. \n\n### onServiceResolved\n\nAdded in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onServiceResolved(serviceInfo: NsdServiceInfo!): Unit\n```\n\nCalled on the internal thread or with an executor passed to android.net.nsd.NsdManager#resolveService to report the resolved service info. A resolution operation would call either onServiceResolved or onResolveFailed once based on the result. \n\n### onStopResolutionFailed\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [T Extensions 7](https://developer.android.com/sdkExtensions) \n\n```\nopen fun onStopResolutionFailed(\n serviceInfo: NsdServiceInfo, \n errorCode: Int\n): Unit\n```\n\nCalled once on the internal thread or with an executor passed to android.net.nsd.NsdManager#resolveService to report that stopping resolution failed with an error. A stop resolution operation would call either onResolutionStopped or onStopResolutionFailed once based on the result.\n\n| Parameters ||\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `serviceInfo` | [NsdServiceInfo](/reference/kotlin/android/net/nsd/NsdServiceInfo): This value cannot be `null`. |\n| `errorCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is [android.net.nsd.NsdManager#FAILURE_OPERATION_NOT_RUNNING](/reference/kotlin/android/net/nsd/NsdManager#FAILURE_OPERATION_NOT_RUNNING:kotlin.Int) |"]]