How can you decide which phone would be the Group Owner of the Direct Network before connecting to it in Android Studio?
Or would it just be the first device to connect when al history of previous connections is deleted, and if so how do you delete the history of previous connections in Android Studio?
How I currently disconnect where I assumed removeGroup removed the history of having that group but probably not as no matter on which phone I click connect on only a specific one becomes the GroupOwner:
@Override
public void disconnect() {
manager.removeGroup(channel, new ActionListener() {
@Override
public void onFailure(int reasonCode) {
Log.d(TAG, "Disconnect failed. Reason :" + reasonCode);
}
@Override
public void onSuccess() {
fragment.getView().setVisibility(View.GONE);
}
});
}
How I currently Connect:
@Override
public void connect(WifiP2pConfig config) {
manager.connect(channel, config, new ActionListener() {
@Override
public void onSuccess() {
}
@Override
public void onFailure(int reason) {
Toast.makeText(WiFiDirectActivity.this, "Connect failed. Retry.",
Toast.LENGTH_SHORT).show();
}
});
}
What calls the connect function:
WifiP2pConfig config = new WifiP2pConfig();
config.deviceAddress = device.deviceAddress;
config.wps.setup = WpsInfo.PBC;
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
}
progressDialog = ProgressDialog.show(getActivity(), "Press back to cancel",
"Connecting to :" + device.deviceAddress, true, true );
((InterfaceListener) getActivity()).connect(config);
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
i have non-Activity class QtAdMobBanner that store reference to main Activity (simplified code below), why reference that set once at initialization still valid after activity created/destroyed (ActivityLifecycleCallbacks still work)?
I'm creating an intent to share and open with the default calendar appI want to add an attendee email, but can't find how it's done
Im recently struggling with a problem where my Build Variants is not working properlyI can't select variants, there is just a ----- on the selection row
"Using the default milestones requires the directions route to include the route options object"