Samsung Electronics logo

Removing Call History Items



Learning how to remove call history items allows you to keep the call history list organized and save storage space on the device:

  1. Use the remove() method of the CallHistory interface to remove a specific item from the call history. First, search for the entry to be removed with the find() method, and then handle the removal in the event handler that is called when the find() method is successful.

    /* Remove the found call history item */
    function onSuccess(results) 
    {
       if (results.length > 0)
          webapis.callhistory.remove(results[0]);
    }
    
    var numberFilter = new webapis.AttributeFilter("remoteParties.remoteParty", 
                                                 "EXACTLY", "123456789"); 
    /* Search for the item to be removed */
    webapis.callhistory.find(onSuccess, onError, numberFilter, null, 1);
    
  2. To remove multiple call history items, use the removeBatch() method.

    The removeBatch() method functions similarly as the remove() method, except that it removes a list of call history items instead of a single item:

    /* Define success callback */
    function onSuccess(results) 
    {
       webapis.callhistory.removeBatch(results, removeBatchSuccess, removeBatchError);
    }
    
    var numberFilter = new webapis.AttributeFilter("remoteParties.remoteParty", 
                                                 "EXACTLY", "123456789"); 
    webapis.callhistory.find(onSuccess, onError, numberFilter);
    
  3. To remove all call history items, use the removeAll() method::

    webapis.callhistory.removeAll();