ATM I get the number and label of a given CONTACT_ID with
String where = ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = " + contactId;
Cursor c = ctx.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, where, null, null);
while (c.moveToNext()) {
String number = Tools.getString(c, CommonDataKinds.Phone.NUMBER);
String label = Tools.getString(c,CommonDataKinds.Phone.LABEL);
}
Android has the ability to mark a given number as "default number". How can I find out if the queried number is the default number?
What is this? Launch the Phone app > select the Contacts tab at the bottom right. Tap on the desired contact > Tap the “i” icon to open the contact details. Select the number you wish to set as default.
The default phone number is used when you initiate a call or send a text message using the Context menu that opens when you touch and hold the contact's entry.
Open up the Google Contacts app on Android. Go to the desired contact (do not edit the contact). Long press the phone number you want to set as the default number.
If you want to specify which number should be called when tapping a contact, then open the Contacts App, tap on the contact, then tap and hold on the "Call" button at the top of the contact, and select the number to call from the list. It will set that number as the default option for Calls for that specific Contact.
Try to query for the column IS_SUPER_PRIMARY in your CONTENT_URI query.
If it returns a non-zero value then the entry may be interpreted as the default contact value of its kind (for example, the default phone number to use for the contact).
More info: http://developer.android.com/reference/android/provider/ContactsContract.Data.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With