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

the background color of the fact text is not changing ?what to do ?

i have dynamically changed the background color of the screen so that on clicking the button background color changes but the background color of the fact text is not changing.

We need more information than that. If you can, you should add snippets of code for us to review. Even better, a link to your applications GitHub repository would be easier, if you have one set up that is.

1 Answer

This is the code inside onClick() :

 public   void onClick(View view)
            {
                String fact = mFactBook.getFact(); // Picks a random fact
                int color = mColorWheel.getColor();  // Picks a random color
                factLabel.setText(fact);  // Displays the fact

                relativeLayout.setBackgroundColor(color);   // Sets background color 
                showFact.setTextColor(color);  // Sets the button text color
            }