我使用的是一個ListActivity,我得到了WIFI範圍內的接入點,並將它們列在一個列表中。 我一直在成功做到這一點,但我希望在點擊頁腳按鈕時獲得cheked項目。我如何讓他們到一個字符串數組?Android,在ListActivity上獲取cheked項目
這是代碼:
public class APselection extends ListActivity {
protected static final String TAG = "teste";
/** Called when the activity is first created. */
private TextView mScanList;
public List<ScanResult> listaAPs;
protected WifiManager wifiManager;
private IntentFilter mWifiStateFilter;
public String SCAN;
public String[] SCANed;
public String scanAP;
public ListView lv;
public ListView lv1;
public List<Long> list = new ArrayList();
public String[] checked;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
View footer = View.inflate(this, R.layout.footer, null);
wifiManager= (WifiManager)getSystemService(Context.WIFI_SERVICE);
int i;
//function to get the APs
SCANed=handleScanResultsAvailable().split("SPl");
lv=getListView();
lv.addFooterView(footer);
setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_multiple_choice, SCANed));
lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
lv.setTextFilterEnabled(false);
}
}