Questions tagged [contactscontract]

Android's Contacts API is defined in the android.provider.ContactsContract and related classes.

The Android platform provides a Contacts API for managing and integrating contacts from multiple accounts and from other data sources.

To handle overlapping data from multiple sources, the contacts content provider aggregates similar contacts and presents them to users as a single entity.

ContactsContract defines an extensible database of contact-related information. Contact information is stored in a three-tier data model: Contacts, Raw Contacts and Data.

More information can be found in the documentation for the ContactsContract class.

551 questions
0
votes
2 answers

Android How to read android Contacts and SIM Contacts?

I am currently getting read only android contacts, below is the code I'm using: String[] projecao = new String[] { Contacts._ID, Contacts.LOOKUP_KEY, Contacts.DISPLAY_NAME }; String selecao = Contacts.HAS_PHONE_NUMBER + " = 1"; Cursor contatos =…
weldsonandrade
  • 606
  • 1
  • 9
  • 25
0
votes
1 answer

Add contact inside a group with group id

I need to insert a contact inside a group. I have the id of the group. But I can't. Don't know why. Can anyone help me? Here is my code. ArrayList ops = new ArrayList(); Account[] accounts =…
Ricardo Filipe
  • 435
  • 4
  • 8
  • 24
0
votes
4 answers

onactivityforresult not called after contactscontract action_edit

I have a ListActivity which displays all the aggregate contacts. When the user clicks one, my code calls startActivityForResult. All this works properly. When the user finishes editing, I want my ListActivity to be displayed again. Instead, the…
Peri Hartman
  • 19,314
  • 18
  • 55
  • 101
0
votes
1 answer

Get contacts from contact group based on group ID

I have a found a great code on how to retrieve contact groups from the phone: final String[] GROUP_PROJECTION = new String[] {ContactsContract.Groups._ID, ContactsContract.Groups.TITLE }; Cursor cursor =…
erdomester
  • 11,789
  • 32
  • 132
  • 234
0
votes
1 answer

how to scroll to particular item in listview based on text entered in edittext?

I have created a multiple contacts picker in which i am showing list of all the contacts in the listview with checkbox, but what i want to do is that now i want to place one edittext at the top so as to allow user to scroll through the list quickly.…
Tapan Desai
  • 848
  • 2
  • 14
  • 36
0
votes
2 answers

facing difficulties in getting contacts in listview

I am trying to get all the contacts of the phone in a listview with checkboxes in order to select multiple contacts at a time. I have written some code which is creating the same number of rows as the number of contacts in my emulator. But the…
Tapan Desai
  • 848
  • 2
  • 14
  • 36
0
votes
1 answer

Inserting contact with android and querying the result uri returns no entries

Im developing an application which is dealing with the android contacts API. I implemented methods to insert, update and query contacts. So far everything worked (writing and reading contacts). At one point in my project Im experiencing a strange…
0
votes
1 answer

How to trigger an alert message for user when there's no match with built-in contacts and database table?[Android]

I'm working on an app where I've a ListView of contacts' names retrieved from the built-in contacts list. I use ContentProvider to get the names from the built-in contacts list. Plus, I store the names from the ListView into my database table. I…
Preeyah
  • 363
  • 3
  • 16
  • 42
0
votes
1 answer

Contact Picker not returning result

From input box, I am throwing a dialog to pick up the contacts. My code looks like below public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); …
yogsma
  • 10,142
  • 31
  • 97
  • 154
0
votes
1 answer

Distinguish email addresses of a contact

I have 3 email's of the same contact. I need to update this emails to phone book of Android. The problem is that when I try do this, the 3 email's are updated the same way. The 3 email's stay equals. Exist any way to distinguish the emails? Here is…
0
votes
1 answer

Update a label of email adrress

I need to update the Label email address on phone book of android. Anyone know how i can do this? Here is my code String stEtEmail = etEmail.getText().toString(); //EMAIL String stBtnLabelEmail = etBtnLabelEmail.getText().toString(); …
Ricardo Filipe
  • 435
  • 4
  • 8
  • 24
0
votes
1 answer

Update Emails that have the same type(e.g TYPE_HOME) with different strings

Anyone knows how I can update two emails in phone book of android with same TYPE (for example: TYPE_HOME), but update each mail with a different string. In my way I update the emails, but the emails that have the same TYPE, are updated…
0
votes
1 answer

Not able to fetch the correct Birthday and Anniversary data from Contact

I am able to fetch other information (Display name,organisation,phone no and email_id) of a contact, but not able to fetch birthday and anniversary of that contact. Here is the code i am using for birthday. It does fetch the data, but gives me wrong…
Beenal
  • 317
  • 1
  • 3
  • 14
0
votes
1 answer

I don't get the email contact on Android

Hy everybody. I need to get the email contact that I have in android by id of contact. But it returns a null value. Don't return nothing and i don't know where I'm failed. public Cursor cursorEmailByContactId(long contactId) { Uri uri =…
Ricardo Filipe
  • 435
  • 4
  • 8
  • 24
0
votes
1 answer

How to get Contact Information in Android?

I want to get Contact Image, Name, Number from my mobile using android. im using ContactsContract to fetch these information. but i can't. can anyone know the exact tutorial for learning. i want to list these info in a custom listview. Thanks in…
Amarnath
  • 1,091
  • 3
  • 19
  • 32