I'm using this code to retrieve all contact names and phone numbers:
String[] projection = new String[]
{
People.NAME,
People.NUMBER
};
Cursor c = ctx.getContentResolver().query(People.CONTENT_URI, projection, null, null, People.NAME + "…
I would like to retrieve the name of a contact associated with an incoming telephone number. As I process the incoming number in the broascastreceiver having a String with the name of the incoming caller would help my project greatly.
I would think…
I am getting this error when I am trying to read contacts from phone and I included READ_CONTACTS permission in Manifest file. And the strange thing is that it was working fine in Eclipse but when I converted my project to Gradle and run it in…
I currently have a base activity which is hosting a single fragment. Inside the fragment I have a method which starts the contact chooser.
private void chooseContacts() {
Intent pickContactIntent = new Intent(Intent.ACTION_PICK, …
i want to pick a contact with it's number from my contacts list.
i read a lot of solutions and research for couple weeks but all of articles didn't work properly.
some codes like following:
Intent intent = new Intent(Intent.ACTION_PICK,…
In my app, user writes a phone number, and I want to find the contact name with that phone number?
I usually search the contacts like this:
Cursor cur = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,
null, null,…
I am trying to save all contacts telephone numbers in an ArrayList but I cant find a way how. Is there a way to get them instead of picking them one by one with ContactsContract?
I try the following code to remove contact with a specified number:
private void removeContact(Context context, String phone) {
//context.getContentResolver().delete(Contacts.Phones.CONTENT_URI, phone, null);
…
I am trying to insert new RawContact contacts, but the RawContact added doesn't get displayed when I view the contacts through Contacts or phonebook. As I understand if we create a RawContact and there is no contact associated with it then the…
I have to try to get WhatsApp contacts from phone and I get a total Count of WhatsApp contact but from RawContacts how to get WhatsApp numbers and names that I don't know. I have tried to find a solution but can't get the exact solution for that.…
When I'm trying to get the phone numbers from the contact list of the phone. The problem is, when I'm running the app while the contact list in the phone is empty, the app is stopped. I checked it and this is because the cursor is empty.
How can I…
For one of my apps, I need the user to select one of his existing contacts or to create a new one.
Picking one is clearly easy to do with the following code:
i = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI);
startActivityForResult(i,…
How to get the following fields from Android contacts? I used Android 2.2.
Name prefix
First name
Middle name
Last name
Name prefix
Phonetic given name
Phonetic middle name
Phonetic family name
I'm working on a simple app that browses through the user's contacts. Unfortunately I keep getting the following error:
java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.HtcContactsProvider2 uri…