7


Me started an activity like this

Intent mainIntent = new Intent(v.getContext(), Second.class);
startActivity(mainIntent);
overridePendingTransition(android.R.anim.slide_out_right,
 android.R.anim.slide_in_left);

I have set overridePendingTrasition for animation.
You can see i have set animation the oposite to the normal android startactivity animation. So now this two animation get collapsed each other.
I want block the default animation (left->right) for while we use start activity
Thank you

asked Feb 14, 2011 at 4:27
3
  • What means "block"? You want to remove it? Commented Feb 14, 2011 at 5:25
  • 1
    yes. I need only the one that i specify using overridePendingTransition Commented Feb 14, 2011 at 5:34
  • The animation you specify there replaces whatever animation would normally run. You need to specify two animations, one for your new activity that is being shown, and the other for the old activity that is going away. Commented Feb 14, 2011 at 6:09

1 Answer 1

22

You can prevent the default animation by setting flag FLAG_ACTIVITY_NO_ANIMATION
like this

mainIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
answered Feb 14, 2011 at 5:43
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.