Hello,
I have a problem deleting SMS.
Until now, on old devices, the app works well.
The APP isn't on "Google Play Store", so I don't use "intent".
On manifest I have:
Note that android:targetSdkVersion="22" is because so I don't need RuntimePermission, but, if I need it, I will add it
With my phone I send an SMS to myself, and then run this program:
But it don't delete messages
Thanks for your help
Sergio
I have a problem deleting SMS.
Until now, on old devices, the app works well.
The APP isn't on "Google Play Store", so I don't use "intent".
On manifest I have:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddPermission(android.permission.SEND_SMS)
AddPermission(android.permission.READ_SMS)
AddPermission(android.permission.WRITE_SMS)
Note that android:targetSdkVersion="22" is because so I don't need RuntimePermission, but, if I need it, I will add it
With my phone I send an SMS to myself, and then run this program:
B4X:
Dim Cellulare As String = "+39348xxxxxxx" ' here is my phone number
Log("Read SMS (" & Cellulare & ")")
Dim smsmanager As SmsMessages
Dim Lst As List = smsmanager.GetAll()
Log("There are " & Lst.Size & " messages")
Dim smsmsg As Sms
For idx = 0 To Lst.Size - 1
smsmsg = Lst.Get(idx)
If smsmsg.Address = Cellulare Then
Log("delete SMS id: " & smsmsg.Id)
smsmanager.deletesms(smsmsg.Id)
End If
Next
But it don't delete messages
Thanks for your help
Sergio