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
Chris Vassell
277 PointsCrystal Ball Animation not Displaying on Emulator
I am trying to get the CrystalBall animation running. I followed all the steps, it works fine, except the background animation. I uploaded all the files to the specified drawable-mdpi folder. Here's my code for the background animation:
private void animateCrystalBall() {
ImageView crystalBallImage = (ImageView) findViewById (R.id.imageView1);
crystalBallImage.setImageResource(R.drawable.ball_animation);
AnimationDrawable ballAnimation = (AnimationDrawable) crystalBallImage.getDrawable();
if (ballAnimation.isRunning()) {
ballAnimation.stop();
}
ballAnimation.start();
However, when I press the button, it just shows the second image.
3 Answers
Chris Vassell
277 PointsActually NVM,
I forgot to put in the code
animateCrystalBall();
in the Oncreate method
Haha. Forgive me, I'm still a beginner haha.
Ben Jakuben
Treehouse TeacherCool - glad you figured it out on your own!
ecp
838 PointsWoohoo! :D