Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Pretty Litttle Things : Animating the Crystal Ball

What am i doing wrong? it says "Inside animateFrog(), declare an AnimationDrawable variable named 'jumpAnimation'. Initialize it using the 'getDrawable()' method of the 'frogImage' variable. Don’t forget to cast it to an AnimationDrawable with ‘(AnimationDrawable)’!" and this is my work,

public void animateFrog(){
AnimationDrawable jumpAnimation = (AnimationDrawable) mFrogImage.getDrawable();
if(jumpAnimation.isRunning()) { 
jumpAnimation.stop();
}

3 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Can you post the rest of your code? Where are you declaring mFrogImage?

I figured it out, thanks anyway

can you guys help me? I cant figure it out!

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Hi Maham,

Can you post a new question in the forum here and paste in your code?

Oh no worries! I figured it out