I want to rotate
imageview
and then I want to start activity
onClick of imageview
but the problem is that android system doesn't give the time to complete the animation
and launching the activity. So how can I show the animation completely and then calling the activity.
This is my xml code:
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="200"
android:fromDegrees="-7"
android:pivotX="50%"
android:pivotY="50%"
android:repeatMode="reverse"
android:toDegrees="7" />
And this code:
public void onImageViewClicked(View view){
switch(view.getId()){
case R.id.viewstock:
Animation shakeV = AnimationUtils.loadAnimation(this, R.anim.shake);
view.startAnimation(shakeV);
startActivityForResult(intent, 12);
break;
case R.id.about:
Animation shakeA = AnimationUtils.loadAnimation(this, R.anim.shake1);
view.startAnimation(shakeA);
Intent aboutIntent = new Intent(MainActivity.this,AboutActivity.class);
startActivity(aboutIntent);
break;
}
}