I am trying to insert Call Logs in inbox programmatically but I am using getcontentresolver() for insertion. but when i am trying to insert date at that time exception is thrown.
i have String variable “date” in which date is “2011-11-04”. and i am passing it to values.put(CallLog.Calls.DATE, callDate);
my code is here
ContentValues values = new ContentValues();
values.put(CallLog.Calls.NUMBER, callnumber);
values.put(CallLog.Calls.CACHED_NAME, callLogName);
values.put(CallLog.Calls.DATE, callDate);
values.put(CallLog.Calls.DURATION, callDuration);
values.put(CallLog.Calls.TYPE, callType);
getContentResolver().insert(CallLog.Calls.CONTENT_URI,values);
Exception is “java numberformate exception”
CallLog.Calls.DATE – The date the call occured, in milliseconds since the epoch
Type: INTEGER (long)
Convert your date to milliseconds.