如何在列表视图中按字母顺序显示联系人
问题描述:
我有一个自定义列表视图,我需要按字母顺序显示联系人,您能提供示例代码如何实现此目的吗?
I have a custom List view and i need to display the contacts in Alphabetical order can u provide the sample code how can i achieve this?
答
您可以按如下字母顺序获取联系人:
you can get contacts in alphabatical order like this:
Cursor cursor = getContentResolver.query(Phone.CONTENT_URI, null, null, null, Phone.DISPLAY_NAME + " ASC");
请参阅以下链接以获取更多信息:
refer these links for more cearity:
如何获取所有Android联系人,但不包含SIM卡上的联系人
有关列表,您可以参考本教程:
For list you can refer this tutorial: