WifiManager.LocalOnlyHotspotCallback

public static class WifiManager.LocalOnlyHotspotCallback
extends Object

java.lang.Object
   ↳ android.net.wifi.WifiManager.LocalOnlyHotspotCallback


Callback class for applications to receive updates about the LocalOnlyHotspot status.

Summary

Constants

int ERROR_GENERIC

int ERROR_INCOMPATIBLE_MODE

int ERROR_NO_CHANNEL

int ERROR_TETHERING_DISALLOWED

Public constructors

WifiManager.LocalOnlyHotspotCallback()

Public methods

void onFailed(int reason)

LocalOnlyHotspot failed to start.

void onStarted(WifiManager.LocalOnlyHotspotReservation reservation)

LocalOnlyHotspot start succeeded.

void onStopped()

LocalOnlyHotspot stopped.

Inherited methods

Constants

ERROR_GENERIC

added in API level 26
int ERROR_GENERIC

Constant Value: 2 (0x00000002)

ERROR_INCOMPATIBLE_MODE

added in API level 26
int ERROR_INCOMPATIBLE_MODE

Constant Value: 3 (0x00000003)

ERROR_NO_CHANNEL

added in API level 26
int ERROR_NO_CHANNEL

Constant Value: 1 (0x00000001)

ERROR_TETHERING_DISALLOWED

added in API level 26
int ERROR_TETHERING_DISALLOWED

Constant Value: 4 (0x00000004)

Public constructors

WifiManager.LocalOnlyHotspotCallback

added in API level 26
WifiManager.LocalOnlyHotspotCallback ()

Public methods

onFailed

added in API level 26
void onFailed (int reason)

LocalOnlyHotspot failed to start.

Applications can attempt to call startLocalOnlyHotspot(LocalOnlyHotspotCallback, Handler) again at a later time.

Parameters
reason int: The reason for failure could be one of: ERROR_TETHERING_DISALLOWED, ERROR_INCOMPATIBLE_MODE, ERROR_NO_CHANNEL, or ERROR_GENERIC.

onStarted

added in API level 26
void onStarted (WifiManager.LocalOnlyHotspotReservation reservation)

LocalOnlyHotspot start succeeded.

Parameters
reservation WifiManager.LocalOnlyHotspotReservation

onStopped

added in API level 26
void onStopped ()

LocalOnlyHotspot stopped.

The LocalOnlyHotspot can be disabled at any time by the user. When this happens, applications will be notified that it was stopped. This will not be invoked when an application calls close().