34,333
edits
Changes
no edit summary
== Returning Data from an Activity ==
<google>ADSDAQBOX_FLOW</google>
As the example in the previous section stands, whilst data is transferred to ActivityB, there is no way for data to be returned to the first activity (which we will call ActivityA). This can, however, be achieved by launching ActivityB as a sub-activity of ActivityA. An activity is started as a sub-activity by starting the intent with a call to the startActivityForResult() method instead of using startActivity(). In addition to the intent object, this method is also passed a request code value which can be used to identify the return data when the sub-activity returns. For example: