使用Android的Intent调用另外一个activity的时候,采用的是异步方式。startActivityForResult之后被调用activity并没有马上返回结果给调用activity,Android的Acitivity对象中startActivityForResult的源代码中有相关的解释。
可以重载activity的onActivityResult() 方法,完成事件的处理。
/**
* Launch an activity for which you would like a result when it finished.
* When this activity exits, your
* onActivityResult() method will be called with the given requestCode.
* Using a negative requestCode is the same as calling
* { @link #startActivity} (the activity is not launched as a sub-activity).
*
* <p>Note that this method should only be used with Intent protocols
* that are defined to return a result. In other protocols (such as
* { @link Intent#ACTION_MAIN} or { @link Intent#ACTION_VIEW}), you may
* not get the result when you expect. For example, if the activity you