簡體   English   中英

將檢索到的聯系人存儲在我們自己的android應用中的最佳方法?

[英]Best way to store retrieved contacts in our own android app?

我嘗試使用哈希圖,但有人建議哈希圖對存儲聯系人不可靠。 而且,我每次運行應用程序時都無法執行檢索操作。 因此,建議我任何有用的方式來存儲聯系人。 如果可能的話,請提供鏈接,以幫助我進一步參考。

這是用於從電話檢索聯系人的代碼

 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM