1 How to use the Dialog dialog box to appear and disappear
<span style= "White-space:pre" ></span>final Dialog Dialog = new Dialog (this);d ialog.show (); window window = Dialog.getwindow (); Windowmanager.layoutparams LP = Window.getattributes (); Window.setcontentview (r.layout.dialog); lp.windowAnimations = r.style.customstyle;window.setattributes (LP);
Styles in
<style name= "Customstyle" >
<item name= "@android: Windowenteranimation" > @anim/in</item>
<item name= "@android: Windowexitanimation" > @anim/out</item>
</style>
2 change of style of the activity's jump
<style name= "customstyle_activity" parent= "Android:Theme.NoTitleBar" >
<item name= "Android:windowanimationstyle" > @style/fade</item>
</style>
<style name= "Fade" parent= "@android: Style/animation.activity" >
<item name= "Android:activityopenenteranimation" > @anim/in</item>
<item name= "Android:activityopenexitanimation" > @anim/out</item>
<item name= "Android:activitycloseenteranimation" > @anim/in</item>
<item name= "Android:activitycloseexitanimation" > @anim/out</item>
</style>
The main one is to remember these six attributes:
Code download
http://download.csdn.net/detail/wanghao200906/8193213
Android dialog and activity changes to a vanishing animation style