OK. The Code is as above. There may be some questions about the parameters at this time. Let's look at the help of the android SDK to make it clearer. I have found some articles on the Internet that indicate that the confusion between requestcode and resultcode is incorrect.
Startactivityforresult (intent, int requestcode)Intent passed to B. It doesn't explain. If you don't understand it, you can still play with your phone. Don't worry about development. requestcode> = 0 is good. It can be used in onactivityresult () which sub-module is used to return data? If C. for Java, D, and even e sub-modules, it is better to separate different requestcodes for each partition.
Setresut (INT resultcode, intent)Resultcode if the submodule B may return several different results, you can use this parameter to identify and distinguish. There is also a special result_ OK value here, it is good to use it without special circumstances, the SDK has instructions, ah. Intent continues without explanation. onactivityresult () returned to ()
Onactivityresult (INT requestcode, int resultcode, intent)There is no need to explain the above three items. If you do not distinguish requestcode from resultcode, there will be no difference as long as other activities setresult reach a onactivityresult.
Turn: http://elvajxw.iteye.com/blog/883612