Hello,
If I was to use a service, and in that service I created the following:
Service1:
And from a Activity I had a few buttons..
When I press button 1, it will start the service.
Then press button 3 to change the value of the string and then I press button 2 to stop the service.
If I then start the service again with button 1 should the test1 string in the service still be set to 'hello' or will it kill the complete service and all values in the service be back to default when I start it again (this all done with the app open) ?
If I was to use a service, and in that service I created the following:
Service1:
B4X:
'Service module
Sub Process_Globals
Dim test1 As String
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
End Sub
Sub Service_Destroy
Log("goodbye")
End Sub
And from a Activity I had a few buttons..
B4X:
Sub Button1_Click
StartService(Service1)
End Sub
Sub Button2_Click
StopService(Service1)
End Sub
Sub Button3_Click
Service1.test1 = "hello"
End Sub
When I press button 1, it will start the service.
Then press button 3 to change the value of the string and then I press button 2 to stop the service.
If I then start the service again with button 1 should the test1 string in the service still be set to 'hello' or will it kill the complete service and all values in the service be back to default when I start it again (this all done with the app open) ?