문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top