WifiP2pManager.RequestPeers Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Request the current list of peers.
[Android.Runtime.Register("requestPeers", "(Landroid/net/wifi/p2p/WifiP2pManager$Channel;Landroid/net/wifi/p2p/WifiP2pManager$PeerListListener;)V", "GetRequestPeers_Landroid_net_wifi_p2p_WifiP2pManager_Channel_Landroid_net_wifi_p2p_WifiP2pManager_PeerListListener_Handler")]
public virtual void RequestPeers(Android.Net.Wifi.P2p.WifiP2pManager.Channel? channel, Android.Net.Wifi.P2p.WifiP2pManager.IPeerListListener? listener);
[<Android.Runtime.Register("requestPeers", "(Landroid/net/wifi/p2p/WifiP2pManager$Channel;Landroid/net/wifi/p2p/WifiP2pManager$PeerListListener;)V", "GetRequestPeers_Landroid_net_wifi_p2p_WifiP2pManager_Channel_Landroid_net_wifi_p2p_WifiP2pManager_PeerListListener_Handler")>]
abstract member RequestPeers : Android.Net.Wifi.P2p.WifiP2pManager.Channel * Android.Net.Wifi.P2p.WifiP2pManager.IPeerListListener -> unit
override this.RequestPeers : Android.Net.Wifi.P2p.WifiP2pManager.Channel * Android.Net.Wifi.P2p.WifiP2pManager.IPeerListListener -> unit
Parameters
- channel
- WifiP2pManager.Channel
The channel created by Initialize(Context, Looper, WifiP2pManager+IChannelListener).
- listener
- WifiP2pManager.IPeerListListener
for callback when peer list is available. Can be null.
- Attributes
Remarks
Request the current list of peers.
On Android 13 (API level 33) or later, if the app targets API level 33 or later, it needs android.permission.NEARBY_WIFI_DEVICES. If the app does not declare android:usesPermissionFlags="neverForLocation" for that permission, it also needs android.permission.ACCESS_FINE_LOCATION. On earlier Android versions, or if the app targets an earlier API level, it needs android.permission.ACCESS_FINE_LOCATION.
Android reference for android.net.wifi.p2p.WifiP2pManager.requestPeers.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.