First of all, to say is the Activitya to Activityb of the relatively simple switch, as long as Overridependingtransition (In,out). I won't say it here. But here to say the name of the Activitya can not tabhost one inside. Because Tabhost inside has its own activity actually did not jump out of tabhost life. This can be log,tabhost the life cycle of the test will know. In fact tabhost inside nested activity all in the life cycle are in tabhost inside. In this case, the activity inside the tabhost jumps to the other (non-tabhost activity), calling Overridependingtransition (In,out). The jump effect is still the default, so the effect of the code will not appear.
For example:
You click on a child of the ListView inside. Jump out of Tabhost you call Overridependingtransition (In,out) in the Click event. It's no use.
Now solve this problem: Because Tabhost also has its own default overridependingtransition () method, I solve the method is to inherit Overridependingtransition (In,out) is called in the OnPause () method of the tabactivity activity. In,out This two parameter is placed inside a class. This way, you can call the method that modifies the two parameters where you want to go. Code:
Public classAnimcommon { Public Static int inch=0; Public Static int out=0; Public Static void Set(intAintb) {inch=A; out=b;} Public Static voidClear () {inch=0; out=0;}}
The following is the Tabactivity class of OnPause ()
@Override protected void OnPause () {System. out. println ("pause"); if (Animcommon. in! =0 && Animcommon. Out! =0) {super.overridependingtransition (Animcommon. in, Animcommon. out ); Animcommon.clear ();} Super.onpause ();}
Here is the code for the jump:
New Intent (informactivity. this, informitemactivity. class ); Animcommon. Set (R.anim.zoom_enter,r.anim.zoom_exit); startactivity (intent);
Animation jumps between Android tabactivity and activity (the animation effect that jumps out in the main tabhost resolves)