I've programmed an android App, everything works fine, exept for one thing: when i switch from one activity to another, it makes this "activity opens" animation, you know, when it opens like a new app. Is there any way to open an activity without that Animation? Thanks
-
Use Fragments, they are better suited for your needs. More details [Here](http://developer.android.com/guide/components/fragments.html) – Skynet May 04 '14 at 09:11
2 Answers
You can try to use a Flag
with your Intent
as follows:
Intent intent = new Intent(Activity1.this, Activity2.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent);
But keep in mind:
If set in an Intent passed to Context.startActivity(), this flag will prevent the system from applying an activity transition animation to go to the next activity state. This doesn't mean an animation will never run -- if another activity change happens that doesn't specify this flag before the activity started here is displayed, then that transition will be used. This flag can be put to good use when you are going to do a series of activity operations but the animation seen by the user shouldn't be driven by the first activity change but rather a later one.
Or you can define a custom animation in your style with @android:style/Animation.Activity
parent as @null
parameter for the animations that you do not want.
After starting intent you can use:
overridePendingTransition(0, 0);
To remove any animation. First parameter goes for animating opening activity and second for activity that is moved back. Both refer to anim resource

- 1,203
- 1
- 13
- 26
-
Adding Intent.FLAG_ACTIVITY_NO_ANIMATION helped for all activities except home activity. This command fixed it. – David Vareka Aug 11 '17 at 14:01