Added in API level 29

P2pStateListener

interface P2pStateListener
android.net.wifi.p2p.WifiP2pManager.P2pStateListener

Interface for callback invocation when p2p state is available in response to requestP2pState.

Summary

Public methods
abstract Unit

The requested p2p state is available.

Public methods

onP2pStateAvailable

Added in API level 29
abstract fun onP2pStateAvailable(state: Int): Unit

The requested p2p state is available.

Parameters
state Int: Wi-Fi p2p state Value is android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_DISABLED, or android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_ENABLED