I am trying to get my bonded bluetooth devices but I can get it as a long string instead of list.
This is my code:
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
ArrayList<String> listview =
new ArrayList<String>(Arrays.asList(pairedDevices.toString()));
setListAdapter(new ArrayAdapter<String>(this, R.layout.list, listview));
I am getting something like this: [00:23:7F:1c, f0:09:f1:b4:b0]
. And its all in one line.
How can I change it to be in a list and not all in one line?
Also, how can I get the friendly names of the devices and not these numbers?
Thanks!!!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…