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.
Post History
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==""...
#1: Initial revision
event_start always returning contact number in android
Why `ContactsContract.CommonDataKinds.Event.START_DATE` always returning contact number. The number is available in Google Contacts. ![img](https://imgur.com/BpLROwa.png) ![img](https://imgur.com/p4YTrJU.png) Here what I am doing... ```java 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. ```java birthday = fetchSpecificContact.get(Constants.BIRTHDAY); etxtBirthday.setText(birthday); ``` I can't see any problem anywhere. API level 22 maybe. Android version : 5.1.