Overridependingtransition (Enteranim, Exitanim);
Intent Intent =new Intent (this,item2.class); startactivity (Intent); This.finish ();
For the whole application to change the way, then use style control it
1. Create Anim folder in Res folder
2. Add the following files:
Slide_left_in.xml in from the left.
<? XML version= "1.0" encoding= "Utf-8" ?><set xmlns:android= "http://schemas.android.com/apk/ Res/android "> < Translate android:duration= "" Android:fromxdelta= " -100.0%p" android:toxdelta< Span style= "color: #0000ff;" >= "0.0" /></set >
Slide_left_out.xml out from the left.
<? XML version= "1.0" encoding= "Utf-8" ?><set xmlns:android= "http://schemas.android.com/apk/ Res/android "> < Translate android:duration= "" Android:fromxdelta= "0.0" Android:toxdelta= " -100.0%p" /></ set>
Slide_right_in.xml, come in from the right.
<? XML version= "1.0" encoding= "Utf-8" ?><set xmlns:android= "http://schemas.android.com/apk/ Res/android "> < Translate android:duration= "" Android:fromxdelta= "100.0%p" Android:toxdelta= "0.0" /></set >
Slide_right_out.xml, get out from the right.
<? XML version= "1.0" encoding= "Utf-8" ?><set xmlns:android= "http://schemas.android.com/apk/ Res/android "> < Translate android:duration= "" Android:fromxdelta= "0.0" Android:toxdelta= "100.0%p" /></ set>
Properties explained:
Translate position transfer animation effect
Android:fromxdelta= "0"-----------starting from 0 coordinates
Android:toxdelta= " -100%p"------move distance to parent level-100%
Two parameters are the offset distance of the charge relative to the parent
Android:duration= "-----------duration"
3. Modify Theme Styles
<!--Application theme.-<StyleName= "Apptheme"Parent= "Appbasetheme"><!--All customizations, that is, specific to a particular api-level can go.-<ItemName= "Android:windowanimationstyle"> @style/activityanimation</Item></Style><StyleName= "Activityanimation"Parent= "@android: Style/animation"><ItemName= "Android:activityopenenteranimation"> @anim/slide_right_in</Item><ItemName= "Android:activityopenexitanimation"> @anim/slide_left_out</item> <item name= "Android:activitycloseenteranimation" Span style= "color: #0000ff;" >> @anim/slide_left_in</item> <item name< Span style= "color: #0000ff;" >= "Android:activitycloseexitanimation" </item> </< Span style= "color: #800000;" >style>
Android: Change activity switching mode