Wifi Direct Groups Memorised

2019-07-01 23:28发布

问题:

How can I delete the groups memorised by Wifi Direct?

If it is possible, what is the function allowing to delete groups?

thanks.

回答1:

Wi-Fi Direct Persistent groups are not implemented yet as far as I know (in Android API level 17). So you don't have to bother deleting memorised groups as they don't exists (yet).



回答2:

The only way is to delete groups with introspection:

Method deletePersistentGroupMethod = WifiP2pManager.class.getMethod("deletePersistentGroup", WifiP2pManager.Channel.class, int.class, WifiP2pManager.ActionListener.class);

for (int netid = 0; netid < 32; netid++) {
    deletePersistentGroupMethod.invoke(this.manager, this.channel, netid, null);
}