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

i cannot resolve color plz plz help me

public int getColor() {

        // The Buttton was clicked , so update the fact Label with a new Fact
        String color = "";
        //Randomly select a fact
        Random randomGenerator = new Random(); //Construct a new Random number Generator
        int randomNumber = randomGenerator.nextInt(mColors.length);

        color = mColors[randomNumber];
        int colorAsInt = Color.parseColor(color);


        return colorAsInt;
    }
}

i cannot resolve

  int colorAsInt = Color.parseColor(color);

i have an error in (color)

Try this color = mColors(randomNumber); instead of color = mColors[randomNumber];

Whenever you have issues, please look at the logcat for clarification.

Happy coding!