Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
event_start always returning contact number in android
+1
−0
Why ContactsContract.CommonDataKinds.Event.START_DATE
always returning contact number. The number is available in Google Contacts.
Here what I am doing...
Cursor c;
if (contactID=="") {
c = activity.getContentResolver().query(Phone.CONTENT_URI, null, null, null, ContactsContract.Contacts.DISPLAY_NAME + " ASC ");
}else{
StringBuffer whereClause = new StringBuffer();
whereClause.append(Phone.CONTACT_ID);
whereClause.append("=");
whereClause.append(contactID);
c = activity.getContentResolver().query(Phone.CONTENT_URI, null, whereClause.toString(), null, ContactsContract.Contacts.DISPLAY_NAME + " ASC ");
}
birthday = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Event.START_DATE));
For setting in layout.
birthday = fetchSpecificContact.get(Constants.BIRTHDAY);
etxtBirthday.setText(birthday);
I can't see any problem anywhere. API level 22 maybe. Android version : 5.1.
0 comment threads