Skip to content

Instantly share code, notes, and snippets.

@ssaurel
Created May 23, 2018 06:52
Show Gist options
  • Save ssaurel/50fccbeb9f9297712a9b16e3eb934e5d to your computer and use it in GitHub Desktop.
Save ssaurel/50fccbeb9f9297712a9b16e3eb934e5d to your computer and use it in GitHub Desktop.
BroadcastReceiver to list WiFi networks on the SSaurel's Blog
BroadcastReceiver wifiReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
results = wifiManager.getScanResults();
unregisterReceiver(this);
for (ScanResult scanResult : results) {
arrayList.add(scanResult.SSID + " - " + scanResult.capabilities);
adapter.notifyDataSetChanged();
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment