Question

I have this code

    b1.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            intent.putExtra("chapter", 1);
            b1.startAnimation(animZoom1);
            startActivity(intent);
        }});

the method runs all lines in one time, the animation duration is 1.5 seconds but the Activity runs in less than 0.5 seconds I just want to run StartActiviy(intenet); after the animation ends

Was it helpful?

Solution

Use an AnimationListener

in onAnimationEnd start your Activity with the Intent

I just picked the first one from a quick search but, this answer should help. You can also search and find many many many more examples.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top