1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

AndroidGCS Bluetooth: Fix crash when no paired devices

Previously tried to make it list "No devices" but this triggered other
crashes.
This commit is contained in:
James Cotton 2012-08-30 09:45:12 -05:00
parent 0f28f65be6
commit e85d959bf5

View File

@ -44,10 +44,7 @@ public class BluetoothDevicePreference extends ListPreference {
Set<BluetoothDevice> pairedDevices = bta.getBondedDevices();
CharSequence[] entries = new CharSequence[pairedDevices.size()];
CharSequence[] entryValues = new CharSequence[pairedDevices.size()];
if (pairedDevices.size() == 0) {
entries[0] = "No Devices";
entryValues[0] = "";
} else {
if (pairedDevices.size() > 0) {
int i = 0;
for (BluetoothDevice dev : pairedDevices) {
entries[i] = dev.getName();