I use the following code to write message to log, when the message was sent.
But the SMS writen by these code can not show sent state.
My question is that how can I change the SMS sent state to Received or Failed?
So that user can see if the message was sent correctly or not.
Thanks!
But the SMS writen by these code can not show sent state.
My question is that how can I change the SMS sent state to Received or Failed?
So that user can see if the message was sent correctly or not.
Thanks!
B4X:
Sub AddMessageToLogs(body As String, address As String)
Dim r As Reflector
r.Target = r.CreateObject("android.content.ContentValues")
r.RunMethod3("put", "address", "java.lang.String", address, "java.lang.String")
r.RunMethod3("put", "body", "java.lang.String", body, "java.lang.String")
Dim contentValues As Object = r.Target
r.Target = r.GetContext
r.Target = r.RunMethod("getContentResolver")
r.RunMethod4("insert", Array As Object( _
r.RunStaticMethod("android.net.Uri", "parse", Array As Object("content://sms/sent"), _
Array As String("java.lang.String")), _
contentValues), Array As String("android.net.Uri", "android.content.ContentValues"))
End Sub