I have searched and I have not found anything that tells me how to tell the user that he has connected to a network. I know it's something with Broadcast Reciever but I do not know what I have to do. I made one that works for me but it's to list wifis. Tell me if I can modify it to achieve what I want. Thanks for any help.
private final BroadcastReceiver wifiScanReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)) {
wifiList = wifiManager.getScanResults();
showWifis();
}
}
};
public void detectWifi() {
registerReceiver(wifiScanReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
wifiManager.startScan();
}