Dann meinst du sowas ?
L
ist wlanList = new ArrayList();
ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, android.R.id.text1, wlanList);
for(ScanResult sr : wifiScanList)
{
wlanList.add(sr.toString());
}
ListView.setAdapter(adapter);`
Weil hier ist auch nochmal etwas falsch in der 2. Zeile wird ein Fehler angezeigt:
Error: (48, 40) error: no suitable constructor found for ArrayAdapter(,int,int,List)
constructor ArrayAdapter.ArrayAdapter(Context,int,int,List) is not applicable
(actual argument cannot be converted to Context by method invocation conversion)
constructor ArrayAdapter.ArrayAdapter(Context,int,List) is not applicable
(actual and formal argument lists differ in length)
constructor ArrayAdapter.ArrayAdapter(Context,int,int,Object[]) is not applicable
(actual argument cannot be converted to Context by method invocation conversion)
constructor ArrayAdapter.ArrayAdapter(Context,int,Object[]) is not applicable
(actual and formal argument lists differ in length)
constructor ArrayAdapter.ArrayAdapter(Context,int,int) is not applicable
(actual and formal argument lists differ in length)
constructor ArrayAdapter.ArrayAdapter(Context,int) is not applicable
(actual and formal argument lists differ in length)
und in der Letzten Zeile (denke kommt vom oberen Fehler...):
Error: (53, 25) error: non-static method setAdapter(ListAdapter) cannot be referenced from a static context
Empfohlener redaktioneller Inhalt
Mit Deiner Zustimmung wird hier ein externer Inhalt geladen.
Mit Klick auf den oben stehenden Button erklärst Du Dich damit einverstanden, dass Dir externe Inhalte angezeigt werden dürfen. Dabei können personenbezogene Daten an Drittanbieter übermittelt werden. Mehr Infos dazu findest Du in unserer Datenschutzerklärung.