Project fragment jump A new activity, need to execute startactivityforresult, but come back to find fragment inside Onactivityresult not execute, the following solution is:
The first part: Frangment jump activity as follows:
Startactivityforresult ();
I have a baseactivity inherited fragmentactivity inside rewrite:
protected void Onactivityresult (int requestcode, int resultcode, Intent data) {//TODO auto-generated method Stubsuper.ona Ctivityresult (Requestcode, ResultCode, data);}
Be sure to remember to add
<pre name= "code" class= "Java" >super.onactivityresult (Requestcode, ResultCode, data);
My mainactivity inherit baseactivity inside also rewrite:
protected void Onactivityresult (int requestcode, int resultcode, Intent data) {//TODO auto-generated method Stubsuper.ona Ctivityresult (Requestcode, ResultCode, data);}
<span style= "FONT-SIZE:18PX;" > also need to add </span>
Super.onactivityresult (Requestcode, ResultCode, data);
And finally the fragment inside .
public void Onactivityresult (int requestcode, int resultcode, Intent data) {
<span style= "White-space:pre" ></span>//processing logic};
So he can take care of it and thenfragment inside execution!
However, it is not good to set the Android:launchmode= "Singletask" to the target's activity to start the mode!
Android Fragment Onactivityresult does not implement the workaround