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

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
public static final int ERROR_GENERIC

Constant Value: 2 (0x00000002)

ERROR_INCOMPATIBLE_MODE

Added in API level 26
public static final int ERROR_INCOMPATIBLE_MODE

Constant Value: 3 (0x00000003)

ERROR_NO_CHANNEL

Added in API level 26
public static final int ERROR_NO_CHANNEL

Constant Value: 1 (0x00000001)

ERROR_TETHERING_DISALLOWED

Added in API level 26
public static final int ERROR_TETHERING_DISALLOWED

Constant Value: 4 (0x00000004)

Public constructors

LocalOnlyHotspotCallback

Added in API level 26
public LocalOnlyHotspotCallback ()

Public methods

onFailed

Added in API level 26
public void onFailed (int reason)

LocalOnlyHotspot failed to start.

Applications can attempt to call WifiManager.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
public void onStarted (WifiManager.LocalOnlyHotspotReservation reservation)

LocalOnlyHotspot start succeeded.

Parameters
reservation WifiManager.LocalOnlyHotspotReservation

onStopped

Added in API level 26
public 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 LocalOnlyHotspotReservation.close().