Hi!!
I'm a real beginner!!
I have i problem on my code.
-There is a service that wait sms with SMSinterceptor
-The Sub _MessageReceived in the Main read the number and if this match add this number to a listview.
All work, I can select form listview some item too, but when i change orientation the listview lost all text.
The only one difference with all examle si the position of .AddSingleLine(sometinig), mine is inside _MessageReceived sub.
Thank you very much!
Regards
Rick
I'm a real beginner!!
I have i problem on my code.
-There is a service that wait sms with SMSinterceptor
-The Sub _MessageReceived in the Main read the number and if this match add this number to a listview.
All work, I can select form listview some item too, but when i change orientation the listview lost all text.
The only one difference with all examle si the position of .AddSingleLine(sometinig), mine is inside _MessageReceived sub.
Thank you very much!
Regards
Rick
B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim notification1 As Notification
Dim SI As SmsInterceptor
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Numero As Label
Dim Testo As Label
Dim Elencosms As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("GUIsms")
SI.Initialize("SI")
Elencosms.Initialize("Elencosms")
Activity.AddView(Elencosms, 0, 0, 100%x, 100%y)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub SI_MessageReceived (From As String, Body As String) As Boolean
' ToastMessageShow(From, True)
If From = "+0123456789" Then
Numero.text = From
Testo.text = Body
End If
Elencosms.AddSingleLine(Body)
Return True
End Sub
Sub Elencosms_ItemClick (Position As Int, Value As Object)
Testo.text = Value
End Sub