Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Block the default animation for startActivity

Tags:

android


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

like image 805
Jithin Avatar asked Feb 14 '11 04:02

Jithin


1 Answers

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

mainIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
like image 95
Labeeb Panampullan Avatar answered Oct 26 '22 06:10

Labeeb Panampullan