When the Activity uses startActivityForResult, The onActivityResult () is not executed. startactivity
You can use startActivityForResult () and onActivityResult () Methods to pass or receive parameters between activities.
However, sometimes we encounter onActivityResult () not executed,
The first case is that the onActivityResult () method is also executed when startActivityForResult is executed. When we press log, we will find it in the onActivityResult () method.
The resultCode parameter always returns 0. This is related to the Activity loading mode, that is, when activity is set in AndroidManifest. xml
Android: launchMode indicates that onActivityResult () is invalid when Activity is set to singleton mode in android SDK, that is, android: launchMode = "singleTask"
And android: launchMode = "singleInstance" will cause invalid
The second case is startActivityForResult (intent, 0); the second parameter in this method. When we set this parameter to less than 0, we will find that the onActivityResult () method has no response.
Android SDK mentioned that this parameter must be greater than or equal to 0.
In the third case, when startActivityForResult in the TabHost sub-Activity calls other activities, the onActivityResult method does not respond. Let's look at the following link.
Http://www.cnblogs.com/relinson/archive/2012/03/25/startActivityForResult.html
OnActivityResult () in startactivityforresult is not executed
Have you used ActivityGroup? I can't execute it when ActivityGroup is used. Let's talk about the specific situation.
Ask startActivityForResult onActivityResult
It can be solved. In the onActivityResult method, the returned results can be captured. Because A and Activity are put in tabhost, the returned results are not captured in A, but captured in tabhost, so you can capture it in tabhost and pass it to Activity.