The following works quite well for primitive and String types; it is a little more esoteric for other Object Types (since you have keep casting back and forth).
For any variables that I want to refer to in multiple Java Steps; I declare (on the Parameters Tab) a 'local' variable; like 'MyString' - of type 'String' (in this example):
Then back on the 'Steps' Tab, you can refer to this variable directly from any Java step.
So in a later step , you can access the variable's value, note here that we have defined another variable called 'testString' - which is only accessible to this step.
Additionally: you can transfer between 'Local' variables and PRPC Properties and Parameters; using the High Level 'Property-Set' method (and vice versa - in fact I quite often transfer Parameters->Locals as the first step of Activities; so I can get at them a little bit more directly within Java steps if I have to):
When you are dealing with more complex Java Objects; you can still do this , but it is a bit more involved.
Lets say we have an instance of a Java Object of type "java.util.Properties"; we can still define a Local Variable on the Parameters tab: but we can only declare it a generic 'Object' type like this:
But the difference now is that we have to cast back and forth between the specific Java Object (java.util.Properties in our example) and the general 'Object' type in Java; using a 'Method-Local' variable (as opposed to an 'Activity-Local' : what we just call a 'Local' variable).
So first we create our Java Object (an instance of 'java.utils.Properties'); and then transfer to our 'Local' Variable like this:
(Strictly speaking , you do not need the explicit '(Object)' cast there, but it doesn't hurt to signal that is what you are doing here).
And in another Java step we can fetch the value back and re-cast to the original Object.
There is a burden on the Programmer here to essentially know what the Object type should be - which is why I added that to the 'Description' on the parameters tab as a reminder of that.
I hope this helps you with what you need to do with your Activity here !