Error: Cannot access activity object from sub Process_Globals

schimanski

Well-Known Member
Licensed User
Longtime User
I get this Error-message,when I declare a type under Process-Globals.

I want to save the activity-states...
 

agraham

Expert
Licensed User
Longtime User
In order to prevent memory leaks when activities are destroyed and recreated there are many things you cannot declare as variables in Process_Globals. Mostly these are Views. This makes sure that when an Activity is destroyed all references to the Views that were placed on it are deleted so the View can be garbage collected and not cause a memory leak.

So you cannot, for example, place a CheckBox in Process_Globals but you can have a Boolean variable in which you save the state of a CheckBox in Activity_Pause and use that to set the state of the newly created CheckBox in Activity_Resume.
 
Upvote 0
Top