Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. class WifiScanReceiver extends BroadcastReceiver {
  2. @SuppressLint("UseValueOf")
  3. public void onReceive(Context c, Intent intent) {
  4. List<ScanResult> wifiScanList = mainWifiObj.getScanResults();//getting the scan result into a list
  5.  
  6. //saving the scan process into strings for each network
  7. //........................................................
  8. wifis = new String[wifiScanList.size()];
  9. for(int i = 0; i < wifiScanList.size(); i++){
  10. wifis[i] = ((wifiScanList.get(i).BSSID).toString()+" , "
  11. + String.valueOf(wifiScanList.get(i).level) +" , " + String.valueOf(wifiScanList.get(i).frequency));
  12.  
  13. Log.e("WIFI", " : " + wifis[i]);
  14.  
  15. Intent i=new Intent(context, MainActivity.class);
  16. i.putExtra("wifi", wifis[i]);
  17. i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  18. context.startActivity(i);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement