[英]Best way to store retrieved contacts in our own android app?
I tried using hashmap, but some suggested that hash map is not reliable to store contacts. 我尝试使用哈希图,但有人建议哈希图对存储联系人不可靠。 And I cannot perform retrieve operation every time I run the app. 而且,我每次运行应用程序时都无法执行检索操作。 So suggest me any useful way to store contacts. 因此,建议我任何有用的方式来存储联系人。 If possible provide me the link, so that it helps me for further reference. 如果可能的话,请提供链接,以帮助我进一步参考。
This is code for retrieve contacts from phone 这是用于从电话检索联系人的代码
Cursor cursor = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null);
while (cursor.moveToNext()) {
String name = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME_PRIMARY));
String phonenumber = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.