Try using:

this

instead of:

getBaseContext()

Also:

-- Does your listener get called with onAnimationRepeat()?

-- What is the animation?

On Thu, Dec 23, 2010 at 3:37 PM, John Lussmyer <[email protected]> wrote:
> Now, I have the problem that my animation won't repeat.
> It plays just once.
>
> My onCreate does this:
>         testAnimation = AnimationUtils.loadAnimation(getBaseContext(),
> R.anim.testanim);
>         testAnimation.setAnimationListener(mAnimationListener);
>         testAnimation.setDuration(3000);
>         testAnimation.setRepeatCount(10);
>         testAnimation.setRepeatMode(Animation.RESTART);
>
> and my onClick does this:
>             if (running) { // Currently running, stop it
>                 button.setText(R.string.Button01);
>                 testShape.clearAnimation();
>             } else { // Currently stopped, start it
>                 button.setText(R.string.BtnStop);
>                 testShape.startAnimation(testAnimation);
>             }
>
> The animation plays exactly once, and the listeners onAnimationStart() is
> called exactly once.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to