Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

# WifiP2pManager.P2pStateListener

*** ** * ** ***

` public static interface WifiP2pManager.P2pStateListener `   
` `

|---|
| android.net.wifi.p2p.WifiP2pManager.P2pStateListener |

<br />

*** ** * ** ***

Interface for callback invocation when p2p state is available in response to `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager#requestP2pState(android.net.wifi.p2p.WifiP2pManager.Channel,%20android.net.wifi.p2p.WifiP2pManager.P2pStateListener)`.

## Summary

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager.P2pStateListener#onP2pStateAvailable(int)(int state) ` The requested p2p state is available. |

## Public methods

### onP2pStateAvailable

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract void onP2pStateAvailable (int state)
```

The requested p2p state is available.

<br />

| Parameters ||
|---|---|
| `state` | `int`: Wi-Fi p2p state. Value is one of the following: - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager#WIFI_P2P_STATE_DISABLED` - `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager#WIFI_P2P_STATE_ENABLED` |

**See also:**

- `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager#WIFI_P2P_STATE_DISABLED`
- `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager#WIFI_P2P_STATE_ENABLED`