Hello Folks,
i suppose you know this issue and i've read elsewhere some workaround it about. My questions are aimed to show the possible best solutions to bypass this issue.
E.g. i've used the following code:
Sub ShowSMSList
lst.Initialize(Me, svList, "", "lst_Click", "", 1dip)
Dim SmsMessages1 As SmsMessages
Dim List1 As List
Dim l2 As List
Dim cName As String
List1 = SmsMessages1.GetAll
Dim bodySMS As String = "Test Body"
For i = 0 To List1.Size - 1
Dim Sms As Sms
Sms = List1.Get(i)
Try
cName = contactTech.GetContactNamebyPhone(Sms.Address)
Catch
Log(LastException.Message)
End Try
If cName = "" Then
lst.AddItem(Sms.id,False,Sms.Address, bodySMS)
End If
Next
lst.ResizePanel
End Sub
This code is called when an Activity Starts; if this activity is paused and i start again it running the code above once again, a NullPointerException is raised on this line:
cName = contactTech.GetContactNamebyPhone(Sms.Address)
StackTrace Tells:
java.lang.NullPointerException
at com.omnicorp.library.Technis.GetContactbyPhone(Technis.java:39)
at com.omnicorp.library.Technis.GetContactNamebyPhone(Technis.java:23)
.................................
This is pretty strange and i wonder if the developer or someone is aware about this issue.
Do you have any suggestions (Even to try another workaround to bypass the personid = -1 issue) ?
Thank you !