If you are running two activities, I don't think the second one can read any variables from the other activity, it is paused. If you have two activities, in the setup activity, set the variable and write it to a file and read the value back in when you return to the main activity.
If you are using a code module, you set the value with main.myvariable=15