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


Nicholas Notte
Nicholas Notte
729 Points

Crystal Ball, Stage 3, Pretty Little Things, Animation quiz help please

Challenge task 1 of 4 Define a method called 'animateFrog()' and put the existing line of code that declares the 'frogImage' variable inside the curly braces of the new method. Make the method public, return nothing (void), and have no parameters.

package com.example;

import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.graphics.drawable.AnimationDrawable;

public class MainActivity extends Activity {

public void onCreate(Bundle savedInstanceState) {

ImageView frogImage = (ImageView) findViewById(R.id.frog);


1 Answer

Luke O'Neill
Luke O'Neill
7,822 Points

Ill let you figure out what to put inside of the method. But the first part is just telling you to make a new method that is void and has no parameters.

public void animateFrog(){
    //put the frogImage in here