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
NITISH RAMAN
112 Pointsthe 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.
1 Answer
niveditagautam
Courses Plus Student 3,001 PointsThis 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
}
Samuel Havard
6,650 PointsSamuel Havard
6,650 PointsWe 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.