67.4 Handling Intent Results
When an intent returns control to the application, it does so by calling the onActivityResult() method of the activity which started the intent. This method is passed the request code that was handed to the intent at launch time, a result code indicating whether or not the intent was successful and a result data object containing the Uri of the selected file. The following code, for example, might be used as the basis for handling the results from the ACTION_OPEN_DOCUMENT intent outlined in the previous section:
public void onActivityResult(int requestCode, int resultCode,
Intent resultData) {
Uri currentUri = null;
if (resultCode == Activity.RESULT_OK)
{
...