我已经创建了一个名为:ContactsAdapter
的自定义适配器,它继承自BaseAdapter
并实现了ISectionIndexer
。BaseAdapter with AlphabetIndexer
是否可以在不使用ICursor
的情况下在自定义适配器上实现AlphabetIndexer
?原因是,适配器使用List<T>
来存储所有项目。
非常感谢提前!
我已经创建了一个名为:ContactsAdapter
的自定义适配器,它继承自BaseAdapter
并实现了ISectionIndexer
。BaseAdapter with AlphabetIndexer
是否可以在不使用ICursor
的情况下在自定义适配器上实现AlphabetIndexer
?原因是,适配器使用List<T>
来存储所有项目。
非常感谢提前!
简答题; 是的你可以做到这一点,而不使用ICursor
。基本上你实现你的BaseAdapter<T>
ISectionIndexer
实现接口ISectionIndexer
包括下列方法:
public int GetPositionForSection(int section)
{
...
}
public int GetSectionForPosition(int position)
{
...
}
public Java.Lang.Object[] GetSections()
{
...
}
亲切的问候,
如何在将它设置到适配器之前对列表进行排序?
像:
Collections.sort(list, String.CASE_INSENSITIVE_ORDER);
要需要排序的对象列表来实现Comparable
你能否更具体?我不确定这将如何为我提供一个ICursor。非常感谢! –