Added in API level 16

NsdManager.ResolveListener


public static interface NsdManager.ResolveListener

android.net.nsd.NsdManager.ResolveListener


Callback for use with NsdManager#resolveService to resolve the service info and use with NsdManager#stopServiceResolution to stop resolution.

Summary

Public methods

default void onResolutionStopped(NsdServiceInfo serviceInfo)

Called on the internal thread or with an executor passed to NsdManager#resolveService to report the resolution was stopped.

abstract void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode)

Called on the internal thread or with an executor passed to NsdManager#resolveService to report the resolution was failed with an error.

abstract void onServiceResolved(NsdServiceInfo serviceInfo)

Called on the internal thread or with an executor passed to NsdManager#resolveService to report the resolved service info.

default void onStopResolutionFailed(NsdServiceInfo serviceInfo, int errorCode)

Called once on the internal thread or with an executor passed to NsdManager#resolveService to report that stopping resolution failed with an error.

Public methods

onResolutionStopped

Added in API level 34
Also in T Extensions 7
public void onResolutionStopped (NsdServiceInfo serviceInfo)

Called on the internal thread or with an executor passed to NsdManager#resolveService to report the resolution was stopped. A stop resolution operation would call either onResolutionStopped or onStopResolutionFailed once based on the result.

Parameters
serviceInfo NsdServiceInfo: This value cannot be null.

onResolveFailed

Added in API level 16
public abstract void onResolveFailed (NsdServiceInfo serviceInfo, 
                int errorCode)

Called on the internal thread or with an executor passed to 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.

Parameters
serviceInfo NsdServiceInfo

errorCode int

onServiceResolved

Added in API level 16
public abstract void onServiceResolved (NsdServiceInfo serviceInfo)

Called on the internal thread or with an executor passed to NsdManager#resolveService to report the resolved service info. A resolution operation would call either onServiceResolved or onResolveFailed once based on the result.

Parameters
serviceInfo NsdServiceInfo

onStopResolutionFailed

Added in API level 34
Also in T Extensions 7
public void onStopResolutionFailed (NsdServiceInfo serviceInfo, 
                int errorCode)

Called once on the internal thread or with an executor passed to 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.

Parameters
serviceInfo NsdServiceInfo: This value cannot be null.

errorCode int: Value is NsdManager.FAILURE_OPERATION_NOT_RUNNING