Stay organized with collections
Save and categorize content based on your preferences.
WifiP2pManager.P2pStateListener
public
static
interface
WifiP2pManager.P2pStateListener
android.net.wifi.p2p.WifiP2pManager.P2pStateListener
|
Interface for callback invocation when p2p state is available
in response to WifiP2pManager.requestP2pState(Channel, P2pStateListener)
.
Summary
Public methods |
abstract
void
|
onP2pStateAvailable(int state)
The requested p2p state is available.
|
Public methods
onP2pStateAvailable
public abstract void onP2pStateAvailable (int state)
The requested p2p state is available.
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,["# WifiP2pManager.P2pStateListener\n\nAdded in [API level 29](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nWifiP2pManager.P2pStateListener\n===============================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/net/wifi/p2p/WifiP2pManager.P2pStateListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nWifiP2pManager.P2pStateListener\n`\n\n\n`\n\n\n`\n\n|------------------------------------------------------|\n| android.net.wifi.p2p.WifiP2pManager.P2pStateListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface for callback invocation when p2p state is available\nin response to [WifiP2pManager.requestP2pState(Channel, P2pStateListener)](/reference/android/net/wifi/p2p/WifiP2pManager#requestP2pState(android.net.wifi.p2p.WifiP2pManager.Channel,%20android.net.wifi.p2p.WifiP2pManager.P2pStateListener)).\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onP2pStateAvailable](/reference/android/net/wifi/p2p/WifiP2pManager.P2pStateListener#onP2pStateAvailable(int))`(int state) ` The requested p2p state is available. |\n\nPublic methods\n--------------\n\n### onP2pStateAvailable\n\nAdded in [API level 29](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onP2pStateAvailable (int state)\n```\n\nThe requested p2p state is available.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `state` | `int`: Wi-Fi p2p state Value is [WifiP2pManager.WIFI_P2P_STATE_DISABLED](/reference/android/net/wifi/p2p/WifiP2pManager#WIFI_P2P_STATE_DISABLED), or [WifiP2pManager.WIFI_P2P_STATE_ENABLED](/reference/android/net/wifi/p2p/WifiP2pManager#WIFI_P2P_STATE_ENABLED) \u003cbr /\u003e |\n\n**See also:**\n\n- [WifiP2pManager.WIFI_P2P_STATE_DISABLED](/reference/android/net/wifi/p2p/WifiP2pManager#WIFI_P2P_STATE_DISABLED)\n- [WifiP2pManager.WIFI_P2P_STATE_ENABLED](/reference/android/net/wifi/p2p/WifiP2pManager#WIFI_P2P_STATE_ENABLED)"]]