|
@@ -226,6 +226,8 @@ public class WiFiP2pBroadcastReceiver extends BroadcastReceiver implements WifiP
|
|
* Disconnects from the connected wifi direct group if the own device is still connected.
|
|
* Disconnects from the connected wifi direct group if the own device is still connected.
|
|
*/
|
|
*/
|
|
public void disconnect() {
|
|
public void disconnect() {
|
|
|
|
+ if (this.getOwnDevice() == null) return; // no wifi connect
|
|
|
|
+
|
|
if (isConnected||this.getOwnDevice().status == WifiP2pDevice.CONNECTED){
|
|
if (isConnected||this.getOwnDevice().status == WifiP2pDevice.CONNECTED){
|
|
manager.removeGroup(channel, new WifiP2pManager.ActionListener() {
|
|
manager.removeGroup(channel, new WifiP2pManager.ActionListener() {
|
|
private WiFiP2pBroadcastListener eventListener;
|
|
private WiFiP2pBroadcastListener eventListener;
|