incendio Well-Known Member Licensed User Longtime User Mar 24, 2015 #1 Hi all, I have a need to save variable type map on Activity Pause and reuse it on Activity Resume. I have 2 activities, act1 and act2, act1 call act2 with codes something like this : Code: Dim m As Map m.Initialize m.Put("Title1","Sales Report") m.Put("RptTyp","SalesRpt") CallSubDelayed2(act2, "ShowReport",m) And codes on act2, something like these Code: Sub Process_Globals Private PrevParams As Map Private LastParams As Map End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("Template") LastParams.Initialize PrevParams.Initialize End Sub Sub Activity_Resume Log(LastParams.Size) Log(PrevParams.Size) End Sub Sub Activity_Pause (UserClosed As Boolean) PrevParams = LastParams Log(LastParams.Size) End Sub Sub ShowReport(Params As Map) LastParams = Params End Sub PrevParams.Size on Activity Resume always show 0, means map variable is not saved. Can anyone help me how save this variable, also, if possible, not using process global variable? Thanks in advance.
Hi all, I have a need to save variable type map on Activity Pause and reuse it on Activity Resume. I have 2 activities, act1 and act2, act1 call act2 with codes something like this : Code: Dim m As Map m.Initialize m.Put("Title1","Sales Report") m.Put("RptTyp","SalesRpt") CallSubDelayed2(act2, "ShowReport",m) And codes on act2, something like these Code: Sub Process_Globals Private PrevParams As Map Private LastParams As Map End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("Template") LastParams.Initialize PrevParams.Initialize End Sub Sub Activity_Resume Log(LastParams.Size) Log(PrevParams.Size) End Sub Sub Activity_Pause (UserClosed As Boolean) PrevParams = LastParams Log(LastParams.Size) End Sub Sub ShowReport(Params As Map) LastParams = Params End Sub PrevParams.Size on Activity Resume always show 0, means map variable is not saved. Can anyone help me how save this variable, also, if possible, not using process global variable? Thanks in advance.
Erel B4X founder Staff member Licensed User Longtime User Mar 24, 2015 #2 Change: LastParams.Initialize PrevParams.Initialize To: Code: If FirstTime Then LastParams.Initialize PrevParams.Initialize End If Upvote 0
Change: LastParams.Initialize PrevParams.Initialize To: Code: If FirstTime Then LastParams.Initialize PrevParams.Initialize End If
incendio Well-Known Member Licensed User Longtime User Mar 24, 2015 #3 Ok, thanks, it worked. Last edited: Mar 24, 2015 Upvote 0