From: http://blog.sina.com.cn/s/blog_8db8914301010t31.html
First, it is relatively simple to switch from ActivityA to ActivityB, As long as overridePendingTransition (In, out ). I won't talk about it here. However, ActivityA cannot be included in TABHost. Because the Tabhost has its own Activity, but it has not jumped out of the Tabhost life. This can be used for Log and Tabhost lifecycle. In fact, the nested activities in Tabhost are all in the Tabhost lifecycle. In this case, overridePendingTransition (In, out) is called when the Activity In Tabhost jumps to another Activity (not In Tabhost ). The jump effect is still the default, so the effect of such a sentence of code will not appear.
For example:
Click a subitem of ListView. Jump out of Tabhost and you will call overridePendingTransition (In, out) In the click event ). It is useless.
Solve this problem now: Because Tabhost also has its own default overridePendingTransition () method, the solution is to inherit from the onPause () method of TabActivity and call overridePendingTransition (In, out ). Put the In and out parameters In a class. In this way, you can call the method to modify the two parameters at the place to be transferred. Code: public class AnimCommon {public static int in = 0; public static int out = 0; public static void set (int a, int B) {in =; out = B;} public static void clear () {in = 0; out = 0;} below is the onPause () @ Overrideprotected void onPause () {System. out. println ("pause"); if (AnimCommon. in! = 0 & AnimCommon. out! = 0) {super. overridePendingTransition (AnimCommon. in, AnimCommon. out); AnimCommon. clear ();} super. onPause () ;}the following code indicates the redirection: Intent intent = new Intent (InformActivity. this, InformItemActivity. class); AnimCommon. set (R. anim. zoom_enter, R. anim. zoom_exit); startActivity (intent); to solve this problem.