On both of my devices when I try to use WifiP2pManager
's createGroup
or removeGroup
I get the onFailure
callback with 2 (BUSY) as reason
.
I've tried to use suggestion given here WifiP2pManager return BUSY state on CreateGroup (removing group before creating a new one), but it didn't help because I'm always getting onFailure
callback in removeGroup
.
Devices I tested on: LG Optimus G (CM 12.1 - Android 5.1), Gigabyte GSmart Guru G1 (stock Android 4.2).
UPDATE
The code is:
manager.removeGroup(channel, new WifiP2pManager.ActionListener() {
@Override
public void onSuccess() {
Debug.d();
manager.createGroup(channel, new WifiP2pManager.ActionListener() {
@Override
public void onSuccess() {
Debug.d();
}
@Override
public void onFailure(int reason) {
Debug.d("" + reason);
}
});
}
@Override
public void onFailure(int reason) {
Debug.d("" + reason);
}
});