Write call logs in android
<p>I am creating app to read and write call logs using csv file.I can read logs very well but can't write logs here is the code i am using to write.</p>

<pre><code>public  void RestoreCallLogs(String Name,String number,String Date,String Type,String Duration){
        ContentValues values = new ContentValues();

        values.put(CallLog.Calls.NUMBER, number);
        values.put(CallLog.Calls.DATE, Date);
        values.put(CallLog.Calls.DURATION,Duration);
        values.put(CallLog.Calls.TYPE, Type);
        /* if(Type=="Incoming")
           values.put(CallLog.Calls.TYPE, 1);
        else if(Type=="Missed")
            values.put(CallLog.Calls.TYPE, 2);
        else
            values.put(CallLog.Calls.TYPE, 3);*/
        if(Name!="Unknown")
         values.put(CallLog.Calls.CACHED_NAME, Name);
        getContentResolver().insert(CallLog.Calls.CONTENT_URI, values);

    }
</code></pre>

<p>How to fix it please suggest </p>
