Android Question How to clear or remove SMS history from callLog (Sent and Recieved)

Discussion in 'Android Questions' started by lazreg, Feb 19, 2015.

  1. lazreg

    lazreg Active Member Licensed User

    @Erel
    Hi All,,
    i used this code with reflection to clear Call Logs ,but SMS still in the Log Calls, i need a code to clear all logs calls+sms.

    Code:
    Sub DelLogsCalls
    Dim r As Reflector
    r.Target = r.GetContext
    r.Target = r.RunMethod(
    "getContentResolver")
    Dim CONTENT_URI As Object = _
       r.GetStaticField(
    "android.provider.CallLog$Calls""CONTENT_URI")
    r.RunMethod4(
    "delete"Array As Object(CONTENT_URI, NullNull), Array As String("android.net.Uri""java.lang.String""[Ljava.lang.String;"))
    ''You should also add the following permissions:
    ''AddPermission("android.permission.READ_CONTACTS")
    ''AddPermission("android.permission.WRITE_CONTACTS")
    End Sub
    yes i have another question : How to delete all stored contacts & SMS?
     
    Last edited: Feb 19, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

    Starting from Android 4.4 only the default messaging app can write to the sms logs (which are different than the call logs).
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice