Created
May 23, 2018 06:52
-
-
Save ssaurel/50fccbeb9f9297712a9b16e3eb934e5d to your computer and use it in GitHub Desktop.
BroadcastReceiver to list WiFi networks on the SSaurel's Blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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