Skip to content

Instantly share code, notes, and snippets.

@pwittchen
Created August 18, 2014 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwittchen/21f33d97db460513440f to your computer and use it in GitHub Desktop.
Save pwittchen/21f33d97db460513440f to your computer and use it in GitHub Desktop.
@Subscribe
public void connectivityStatusChanged(ConnectivityStatusChangedEvent event) {
// you can perform here any action you want to
// in this example we are displaying toast with Connectivity Status
// and another toast with WiFi info
Toast.makeText(this, event.getConnectivityStatus().toString(), Toast.LENGTH_SHORT).show();
Toast.makeText(this, event.getWifiInfo().toString(), Toast.LENGTH_SHORT).show();
}
@Subscribe
public void wifiAccessPointsRefreshed(WifiAccessPointsSignalStrengthChangedEvent event) {
// you can perform here any action you want to
// in this example we are retrieving list of available access points
// and storing it on the List
WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
List<ScanResult> accessPoints = wifiManager.getScanResults();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment