I have a list wifilist that contains access points informations: This is my list adapter class:
public ListAdapterWifi(Context context, List<ScanResult> wifiList) {
        this.context = context;
        this.wifiList = wifiList;
        inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }
    @Override
    public int getCount() {
        return wifiList.size();
    }
    @Override
    public Object getItem(int position) {
        return null;
    }
    @Override
    public long getItemId(int position) {
        return 0;
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        Holder holder;
        System.out.println("viewpos" + position);
        View view = convertView;
        if (view == null) {
            view = inflater.inflate(R.layout.listeadapter, null);
            holder = new Holder();
            holder.tvDetails = (TextView) view.findViewById(R.id.tvDetails);
            view.setTag(holder);
        } else {
            holder = (Holder) view.getTag();
        }
        holder.tvDetails.setText("SSID :: " + wifiList.get(position).SSID
                + "\nForce du signal reçu :: " + wifiList.get(position).level
                + "\n@ mac du point d'accès :: " + wifiList.get(position).BSSID
                + "\nCanal :: "
                + convertFrequencyToChannel(wifiList.get(position).frequency)
                + "\nFréquence :: " + wifiList.get(position).frequency
                + "\nType de sécurité :: " + wifiList.get(position).capabilities);
        return view;
    }
    public static int convertFrequencyToChannel(int freq) {
        if (freq >= 2412 && freq <= 2484) {
            return (freq - 2412) / 5 + 1;
        } else if (freq >= 5170 && freq <= 5825) {
            return (freq - 5170) / 5 + 34;
        } else {
            return -1;
        }
    }
    class Holder {
        TextView tvDetails;
    }
}
And this is WifiMonitorActivity, the activity that display the list in a listview:
 public class WifiMonitorActivity extends Activity {
    private WifiManager mainWifi;
    private WifiReceiver receiverWifi;
    ListAdapterWifi adapter;
    ListView lvWifiDetails;
    List<ScanResult> wifiList;
    WifiManager wifi;
    double [] queryC = new double[3];
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
     setContentView(R.layout.wifiresult );
     lvWifiDetails = (ListView) findViewById(R.id.lvWifiDetails);
     mainWifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
     receiverWifi = new WifiReceiver();
     registerReceiver(receiverWifi, new IntentFilter(
     WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
     scanWifiList();
    }
    public double [] getRSS(double [] queryC){
        if(wifilist != null){
        for (int i=0; i<wifiList.size(); i++){
        switch (wifiList.get(i).BSSID){ 
          case "56:2f:27:43:4b:f5" : queryC [0]= + wifiList.get(i).level ; break; 
          case "20:16:e8:4f:55:e8": queryC [1]  = + wifiList.get(i).level ; break; 
          case "7c:e8:d3:31:7f:b9": queryC [2] =  + wifiList.get(i).level ; break; 
        }
         }  
}
        return queryC;
        }
    private void setAdapter() {
    adapter = new ListAdapterWifi(getApplicationContext(), wifiList);
    lvWifiDetails.setAdapter(adapter);
    }
    private void scanWifiList() {
    mainWifi.startScan();
    wifiList = mainWifi.getScanResults();
    setAdapter();
    }
    class WifiReceiver extends BroadcastReceiver {
        public void onReceive(Context c, Intent intent) {
        }
    }
    }
I want to extract BSSID corresponding to Access Points with specified SSID And put the 3 BSSID recuperated in the array queryC. then I want to recuperate the queryC in my knn class like this way:
WifiMonitorActivity w = new  WifiMonitorActivity();
        double [] query= w.getRSS(queryC);
the problem is that the queryC is not recuperated, should I use another list instead of wifiList? I'm confused.
Thank's in advance
