Android Studio, lista sparowanych urządzeń bluetoot

0

Dzień dobry
korzystając z tego poradnika : http://android-er.blogspot.com/2014/12/list-paired-bluetooth-devices-and-read.html
dokładnie tego kodu:

 private void setup() {
  Set<BluetoothDevice> pairedDevices = bluetoothAdapter.getBondedDevices();
  if (pairedDevices.size() > 0) {
   pairedDeviceArrayList = new ArrayList<BluetoothDevice>();
   
   for (BluetoothDevice device : pairedDevices) {
    pairedDeviceArrayList.add(device);
            }
   
   pairedDeviceAdapter = new ArrayAdapter<BluetoothDevice>(this,
                 android.R.layout.simple_list_item_1, pairedDeviceArrayList);
   listViewPairedDevice.setAdapter(pairedDeviceAdapter);
   
   listViewPairedDevice.setOnItemClickListener(new OnItemClickListener(){

    @Override
    public void onItemClick(AdapterView<?> parent, View view,
      int position, long id) {
     BluetoothDevice device = 
       (BluetoothDevice)parent.getItemAtPosition(position);
      Toast.makeText(MainActivity.this, 
       "Name: " + device.getName() + "\n"
       + "Address: " + device.getAddress() + "\n"
       + "BondState: " + device.getBondState() + "\n"
       + "BluetoothClass: " + device.getBluetoothClass() + "\n"
       + "Class: " + device.getClass(),
       Toast.LENGTH_LONG).show();
    }});
  }
 }

zrobiłem identycznie i działa, jednak mam pytanie czy da się jakoś to zamienić tak aby wyświetlało listę nazw urządzeń, a ich kody? : )
Z góry dziękuję za pomoc : )

0

Można łatwo zamienić listę na string, all wtedy z oczywistych powodów wyspie się na:
BluetoothDevice device = (BluetoothDevice)parent.getItemAtPosition(position);

1 użytkowników online, w tym zalogowanych: 0, gości: 1