Changes

Jump to: navigation, search

An Overview of Android Intents

No change in size, 18:03, 1 February 2016
m
Text replacement - "<google>ADSDAQBOX_FLOW</google>" to "<htmlet>adsdaqbox_flow</htmlet>"
== Returning Data from an Activity ==
<googlehtmlet>ADSDAQBOX_FLOWadsdaqbox_flow</googlehtmlet>
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:

Navigation menu