Stay organized with collections
Save and categorize content based on your preferences.
Channel
open class Channel : AutoCloseable
A channel that connects the application to the Wifi p2p framework. Most p2p operations require a Channel as an argument. An instance of Channel is obtained by doing a call on initialize
Summary
Public methods |
open Unit |
Close the current P2P connection and indicate to the P2P service that connections created by the app can be removed.
|
Public methods
close
open fun close(): Unit
Close the current P2P connection and indicate to the P2P service that connections created by the app can be removed.
Exceptions |
java.lang.Exception |
if this resource cannot be closed |
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# WifiP2pManager.Channel\n\nAdded in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nChannel\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/wifi/p2p/WifiP2pManager.Channel \"View this page in Java\") \n\n```\nopen class Channel : AutoCloseable\n```\n\n|---|--------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.net.wifi.p2p.WifiP2pManager.Channel](#) |\n\nA channel that connects the application to the Wifi p2p framework. Most p2p operations require a Channel as an argument. An instance of Channel is obtained by doing a call on [initialize](/reference/kotlin/android/net/wifi/p2p/WifiP2pManager#initialize(android.content.Context,%20android.os.Looper,%20android.net.wifi.p2p.WifiP2pManager.ChannelListener))\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [close](#close())`()` Close the current P2P connection and indicate to the P2P service that connections created by the app can be removed. |\n\nPublic methods\n--------------\n\n### close\n\nAdded in [API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun close(): Unit\n```\n\nClose the current P2P connection and indicate to the P2P service that connections created by the app can be removed.\n\n| Exceptions ||\n|-----------------------|-----------------------------------|\n| `java.lang.Exception` | if this resource cannot be closed |"]]