android-contacts

Android Get Contact Picture from Call Log

こ雲淡風輕ζ 提交于 2019-12-18 05:16:31
问题 It was pretty easy to get the Contact picture when querying the People.CONTENT_URI , with a simple People.loadContactPhoto(activity, ContentUris.withAppendedId(People.CONTENT_URI, contactId) because I knew the contact Id. Now I need to do the same thing after accesing the Call log. With: String[] strFields = { android.provider.CallLog.Calls.CACHED_NAME, android.provider.CallLog.Calls.NUMBER, }; String strUriCalls="content://call_log/calls"; Uri UriCalls = Uri.parse(strUriCalls); Cursor

Pick contact directly from contact picker intent

自作多情 提交于 2019-12-18 04:44:23
问题 Hello I want to pick a contact from our default contact book intent. I tried several ways to do it. Please find the code below. The problem with all those code is that they open one intermediate documents screen with few options there user has to select contact and than it opens contact book. private void openContactIntent() { Intent intent = new Intent(Intent.ACTION_GET_CONTENT, ContactsContract.Contacts.CONTENT_URI); intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);

How to avoid duplicate contact name (data ) while loading contact info to listview?

依然范特西╮ 提交于 2019-12-17 18:43:09
问题 I am populating contact list details to list view successfully. My code: String order = ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " ASC"; Cursor curLog = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,null,null,order); How can I avoid the duplicate data In List view as the contact details is repeating if its joined contact i.e. joined with both phone and Google? . The screen is like I want to select programmatically only 1 name not the both?

Android: Manage contacts with lookup key

不羁岁月 提交于 2019-12-17 18:29:21
问题 I'm currently writing a application that allows to save drafts (using android version >= 2.0). Each draft is connected to a contact via the ContactsContract.Contacts.LOOKUP_KEY . My problem is that if I change the name of my contact the lookup key changes also. Is that the way this works? So for what do I need a lookup key? I thought that the lookup key does never change and now it changes anyway. I'm confused about that behavior ... Can someone explain to me how to link permanently to a

How to get Contact ID, Email, Phone number in one SQLite query ? Contacts Android Optimization

妖精的绣舞 提交于 2019-12-17 17:34:23
问题 I want to fetch All Contacts atleast with one phone Number, also I want all Phone Numbers and All emails for every Contact. Current code : // To get All Contacts having atleast one phone number. Uri uri = ContactsContract.Contacts.CONTENT_URI; String selection = ContactsContract.Contacts.HAS_PHONE_NUMBER + " > ?"; String[] selectionArgs = new String[] {"0"}; Cursor cu = applicationContext.getContentResolver().query(uri, null, selection, selectionArgs, null); // For getting All Phone Numbers

using checkbox to filter contacts and get phone number

久未见 提交于 2019-12-17 16:59:50
问题 I am working on an app that works similar to the default text messaging app on all Android phones. My problem is selecting more than one user to send an SMS message to. What I have done so far is stored my contacts as listview items with check boxes. Now I just need to get the phone numbers from the selected contacts. So what I am having trouble on doing. 1) Pulling a phone number from the contacts displayed in my listview 2)displaying that number in a textview in a new activity Sorry if my

Sorted list of contacts having duplicates ,why?

我怕爱的太早我们不能终老 提交于 2019-12-17 14:51:48
问题 I have sorted and listed my phone contacts in to an arraylist but ,i got many duplicates of same contact names in the list .How this happens? how to avoid this? This is what i have tried, cursor = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, "(" + ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + ") ASC"); while (cursor.moveToNext()) { try { name = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME

How to get whatsapp Contacts from Android Programmatically?

眉间皱痕 提交于 2019-12-17 10:19:28
问题 I have try to get whatsapp contact from phone and i get total Count of whatsapp contact but from RawContacts how to get whatsapp Number and name that i don't know. i have tried to find solution but can't get exact solution for that. Please help me. I put my code below. ContentResolver cr = context.getContentResolver(); Cursor c = cr.query( ContactsContract.RawContacts.CONTENT_URI, new String[] { ContactsContract.RawContacts.CONTACT_ID, ContactsContract.RawContacts.DISPLAY_NAME_PRIMARY },

How to get whatsapp Contacts from Android Programmatically?

你。 提交于 2019-12-17 10:18:33
问题 I have try to get whatsapp contact from phone and i get total Count of whatsapp contact but from RawContacts how to get whatsapp Number and name that i don't know. i have tried to find solution but can't get exact solution for that. Please help me. I put my code below. ContentResolver cr = context.getContentResolver(); Cursor c = cr.query( ContactsContract.RawContacts.CONTENT_URI, new String[] { ContactsContract.RawContacts.CONTACT_ID, ContactsContract.RawContacts.DISPLAY_NAME_PRIMARY },

Export the Contacts as VCF file

浪子不回头ぞ 提交于 2019-12-17 07:15:42
问题 I want to export the Phone contacts to External storage area. I didn't work with this type of method. Anyone guide me to do this? 回答1: In your code, you wrote one function but from where is this function called? And what is the meaning of get(View view) function? This function is not being called so it can be removed. I've edited my answer as per your requirements and tested it with 500 Contacts to save a single vCard file with 500 contacts in my sd card. package com.vcard; import java.io