Java tutorial
//package com.java2s; import android.content.ContentResolver; import android.content.ContentValues; import android.provider.CallLog; import android.util.Log; import android.content.ContentResolver; import android.content.ContentValues; import android.provider.CallLog; import android.util.Log; public class Main { public static void insertPlaceholderCall(ContentResolver contentResolver, String name, String number) { ContentValues values = new ContentValues(); values.put(CallLog.Calls.NUMBER, number); values.put(CallLog.Calls.DATE, System.currentTimeMillis()); values.put(CallLog.Calls.DURATION, 0); values.put(CallLog.Calls.TYPE, CallLog.Calls.OUTGOING_TYPE); values.put(CallLog.Calls.NEW, 1); values.put(CallLog.Calls.CACHED_NAME, name); values.put(CallLog.Calls.CACHED_NUMBER_TYPE, 0); values.put(CallLog.Calls.CACHED_NUMBER_LABEL, ""); Log.d("Call Log", "Inserting call log placeholder for " + number); contentResolver.insert(CallLog.Calls.CONTENT_URI, values); } }