Hi all,
since the introduction of the Starter module we were encouraged to use it as the place where to define and initialize our global vars.
A good reason is that it's not a safe assumption to count on Main to be executed as the first Activity when the OS runs our app.
Now, let's say I'd like to keep a Public var in the Activity where it (logically) belongs to. Think of it as the initial data used by the called Activity, where data is initialized and prepared by the calling one.
Things should go something like this:
'Activity 1
...
define a "parameters" map/object/var and initialize it
put items in the map according to what Activity2 expects
Activity2.myvar = "parameters" map
StartActivity2
'Activity2
uses myvar to set up what's needed here
My question is: will it be safe to simply check for the initialization of myvar in Activity2.Resume and eventually initialize it to default or empty values?
Or is it better to stay with the golden rule "every public global var in the Starter"? TIA