Discussion

Out Parameter in Activity

Suppose there are 2 activities viz ActivityA and ActivityB. Now, ActivityB is called from ActivityA. There is an out parameter defined in ActivityB. So, in the step in ActivityA where ActivityB is called, we set this out parameter into a local variable defined in ActivityA. It for some reason doesn't sets the value in local variable. But, when we set the same out parameter in a property, it gets set there. Why is it so???

***Updated by moderator: Marissa to close post***
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

October 22, 2008 - 9:39am

Thanks!I understand your point. The confusing thing is that it seems that its setting the out parameter in the Activity A (under which local variable is defined) and hence should get set there.
The question now arises is if we are not able to set it in a local variable then how to check for this out parameter (without creating a new property and setting in it) because some processing needs to be done in ActivityA based on the value of this parameter. Any clues??

October 30, 2008 - 11:44pm

Hi,

The way I do it is a little round about but works perfectly.... When calling activityB from ActivityA click on the check box that says "Pass current parameter page". When the value is returnred by ActivityB the param will be accessable by activityA. you dont even need to define the property in activityA.

Regards
Sid

October 17, 2008 - 4:09pm

The local variables are transient object whose scope is defined within the activity where its defined.

The out parameter of Activity B is trying to copy the value into a variable that is in the scope of Activity A.

But when you save it to a property, its actually gets set on a clipboard property object which is a persistent through out the requestor's life cycle (of course unless someone removes the object).

July 27, 2015 - 3:27am

Hi,

In activity 1 we are setting the parameter value and in Activity 2 you want use that parameter value as a out put of activity1.

In this case we can check the check box pass current parameter page in second activity then only you will get the output param value