Added fixed ordering for devices.
This commit is contained in:
parent
d8947fff67
commit
0dc71c4025
1 changed files with 11 additions and 1 deletions
|
@ -29,6 +29,7 @@ package com.github.nutomic.controldlna.utility;
|
|||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Comparator;
|
||||
|
||||
import org.teleal.cling.model.meta.Device;
|
||||
import org.teleal.cling.model.meta.LocalDevice;
|
||||
|
@ -115,8 +116,17 @@ public class DeviceArrayAdapter extends ArrayAdapter<Device<?, ?, ?>>
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
if (device.getType().getType().equals(mDeviceType))
|
||||
if (device.getType().getType().equals(mDeviceType)) {
|
||||
add(device);
|
||||
sort(new Comparator<Device<?, ?, ?>>() {
|
||||
|
||||
@Override
|
||||
public int compare(Device<?, ?, ?> lhs,
|
||||
Device<?, ?, ?> rhs) {
|
||||
return lhs.getDisplayString().compareTo(rhs.getDisplayString());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Reference in a new issue