Sort devices lexicographically
This commit is contained in:
parent
fbfc9ed97f
commit
e3f15f7bd8
|
@ -11,8 +11,11 @@ import android.support.v4.content.LocalBroadcastManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.text.Collator;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -133,6 +136,12 @@ public class DeviceManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Collections.sort(deviceList, new Comparator<GBDevice>() {
|
||||||
|
@Override
|
||||||
|
public int compare(GBDevice lhs, GBDevice rhs) {
|
||||||
|
return Collator.getInstance().compare(lhs.getName(), rhs.getName());
|
||||||
|
}
|
||||||
|
});
|
||||||
notifyDevicesChanged();
|
notifyDevicesChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue