十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
通过调用WifiManager类: IntentFilter filter = new IntentFilter(); filter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION); final WifiManager wifiManager = (WifiManager)getApplicationContext().getSystemService(Context.WIFI_SERVICE);; registerReceiver(new BroadcastReceiver(){ @SuppressLint("UseValueOf") @Override public void onReceive(Context context, Intent intent) { sb = new StringBuilder(); scanList = wifiManager.getScanResults(); sb.append("\n Number Of Wifi connections :" + " " +scanList.size()+"\n\n"); for(int i = 0; i < scanList.size(); i++){ sb.append(new Integer(i+1).toString() + ". "); sb.append((scanList.get(i)).toString()); sb.append("\n\n"); } }