第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何將Android Wifi掃描結(jié)果放入列表?

如何將Android Wifi掃描結(jié)果放入列表?

守候你守候我 2019-08-31 11:08:48
我知道如何獲得<List>Android Wifi掃描,但我無法找出制作列表適配器的最佳方法。我想將SSID和BSSID從<List>掃描綁定到text1和text2。我一直在做的樣本wifi.startScan();        // get list of the results in object format ( like an array )        List<ScanResult> results = wifi.getScanResults();`        // loop that goes through list        for (ScanResult result : results) {            Toast.makeText(this, result.SSID + " " + result.level,                    Toast.LENGTH_SHORT).show();和:private void fillDataFromDb() {        Cursor scanCursor = Db.fetchAllScans();        startManagingCursor(scanCursor);`        // Create an array to specify the fields we want to display in the list        // (only TITLE)        String[] from = new String[] { WifiDbAdapter.KEY_BSSID,                WifiDbAdapter.KEY_SSID };        // and an array of the fields we want to bind those fields to (in this        // case just text1)        int[] to = new int[] { R.id.text1, R.id.text2 };        // Now create a simple cursor adapter and set it to display        SimpleCursorAdapter scansdb = new SimpleCursorAdapter(this,                R.layout.scan_row, scanCursor, from, to);        setListAdapter(scansdb);    }
查看完整描述

3 回答

?
揚帆大魚

TA貢獻1799條經(jīng)驗 獲得超9個贊

除了接受的答案,您還需要在AndroidManifest中使用以下權(quán)限才能使其正常工作:


 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

 <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> 


查看完整回答
反對 回復(fù) 2019-08-31
  • 3 回答
  • 0 關(guān)注
  • 788 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號