Tuesday, November 12, 2013

Animation has no effect when switching between activities [android help]


Animation has no effect when switching between activities



I would like to switch the activities using animation.. I have a view with 5 images and with that i set my oncliclk listener. My main activity is



private View.OnClickListener onClickListener = new View.OnClickListener()
{
public void onClick(View testView)
{
if (testView == Main.this.myinput)
{
Intent i = new Intent(Main.this, Activity1.class);
startActivity(i);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}

if (testView == Main.this.myinput)
{
Intent i = new Intent(Main.this, Activity2.class);
startActivity(i);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
}
};


and my animation files are fade_in:




android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="500" />


fade_out:




android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="1.0" android:toAlpha="0.0"
android:fillAfter="true"
android:duration="500" />


Now my problem is when switching between activities, animation has no effects... I referred to satck overflow and googled but couldn't find why animation is not working.. I tried this with various type of animations such as slide_in_left,right,top,bottom... but animation is not working. Help me in resolving this issue.Thanks in advance..



Read more

stackoverflow.comm



No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...