Android examples for Wifi:Wifi Connection
cancel Wifi Disconnect
import android.net.wifi.p2p.WifiP2pManager; import android.net.wifi.p2p.WifiP2pManager.ActionListener; import android.net.wifi.p2p.WifiP2pManager.Channel; import android.util.Log; public class Main { public static void cancelDisconnect(WifiP2pManager wdManager, Channel wdChannel) {/*w ww . j a va2s . co m*/ if (wdManager != null) { wdManager.cancelConnect(wdChannel, new ActionListener() { public void onSuccess() { Log.d("", "Aborting connection"); } public void onFailure(int reasonCode) { Log.d("", "Connect abort request failed. Reason Code: " + reasonCode); } }); } } }