>自定义列表适配器(扩展Baseexpandablelistadapter)
>自定义列表活动(扩展ExpandableListActivity) @H_404_7@询问 @H_404_7@
Cursor cursor = context.getContentResolver() .query(uri,ScheduleData.PROJECTION,null,ScheduleData.soRT_ORDER);@H_404_7@排序 @H_404_7@
public static final String SORT_ORDER = TimeSlots.QUAliFIED_TIMESTART + " ASC"; // timeslots.timestart@H_404_7@失败的主要&二级排序 @H_404_7@
public static final String SORT_ORDER = TimeSlots.QUAliFIED_TIMESTART + " ASC," + Locations.QUAliFIED_name + " ASC"; // timeslots.timestart ASC,locations.name ASC public static final String SORT_ORDER = TimeSlots.QUAliFIED_TIMESTART + "," + Locations.QUAliFIED_name + " ASC"; // timeslots.timestart,locations.name ASC@H_404_7@第二个条款似乎对排序没有影响.这是ExpandableListActivity的限制吗?我应该以不同方式指定多个排序顺序项吗解决方法 事实证明,类中有一个比较器覆盖了ORDERBY子句中指定的排序顺序.当使用上面的ORDERBY子句而没有比较器时,我得到了所需的排序.你可以这样做,但我正在杀死额外的代码并选择ORDERBY子句. @H_404_7@ @H_404_7@比较器路径: @H_404_7@
// Sort childrenCollections.sort(group.children,CHILD_COMParaTOR);// Specify sort by locationstatic final Comparator<Child> CHILD_COMParaTOR = new Comparator<Child>(){ @OverrIDe public int compare (Child child1,Child child2) { return child1.location.tolowerCase().compareto(child2.location.tolowerCase()); }};总结
以上是内存溢出为你收集整理的android – 如何在可扩展列表中指定子项的排序顺序?全部内容,希望文章能够帮你解决android – 如何在可扩展列表中指定子项的排序顺序?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)