Suppose we have the following code:
In ActivityA an instance of SomeClass is created in Process_Globals, and settled properly. Then it calls ActivityB where the same instance from ActivityA is used. My question is will the activitya.ThisIsAPublicClass class always be in memory since the relevant activity is paused? What happens if the class is really memory intensive with Lists and Maps?
If that handle is not safe, is there any other safer way to use the same instance from two activities?
B4X:
'Activity A
Sub Process_Globals
Public ThisIsAPublicVariable As String
Public ThisIsAPublicClass As SomeClass
End Sub
Sub Activity_Create(FirstTime As Boolean)
ThisIsAPublicClass.Initialize("")
'Initialize the class and set properly
startactivity(activityb)
End Sub
'Activity B
Sub Activity_Create(FirstTime As Boolean)
log(activitya.ThisIsAPublicVariable)
log(activitya.ThisIsAPublicClass)
End Sub
Sub SomeFunction
'Work with activitya.ThisIsAPublicClass
End Sub
In ActivityA an instance of SomeClass is created in Process_Globals, and settled properly. Then it calls ActivityB where the same instance from ActivityA is used. My question is will the activitya.ThisIsAPublicClass class always be in memory since the relevant activity is paused? What happens if the class is really memory intensive with Lists and Maps?
If that handle is not safe, is there any other safer way to use the same instance from two activities?