Im trying to get my service to start through the condition of a specific sender of an sms, but i get "java.lang.NullPointerException"
The servicestart works fine without the " If Sms1.Address = "123456" Then"
What am i missing here ?
/Richard
The servicestart works fine without the " If Sms1.Address = "123456" Then"
What am i missing here ?
/Richard
B4X:
'Service module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Type Message (Address As String, Body As String)
Dim Sms1 As Sms
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
If StartingIntent.Action = "android.provider.Telephony.SMS_RECEIVED" Then
Dim messages() As Message
messages = ParseSmsIntent(StartingIntent)
For i = 0 To messages.Length - 1
Log(messages(i))
Next
End If
If Sms1.Address = "123456" Then
StartActivity(Main)
If IsPaused(Main) Then
StartActivity(Main)
End If
Else
CallSub(Main, "RefreshData")
End If
End Sub