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 Build a Simple Android App (2014) Improving Our Code Adding More Colors

Jillsvick Kuri
Jillsvick Kuri
3,002 Points

The color of the text in my button doesn't change when I press it. It keeps being green :(

My app works and I coded along with the teacher but the only issue is at the end, when I change the color of the text in the button, I change it to the same color as the relative layout but when I save and run I see the color of the text in the button keeps being green. It doesn't change :/

alt text

1 Answer

It can be quite difficult for other members if you do not provide any code.

Did you remember to set the text color on the fact button (in the overrode OnClickListener method which is a part of the onCreate method)? That is:

showFactButton.setTextColor(color);

Try to provide some code that you are suspicious about.

Jillsvick Kuri
Jillsvick Kuri
3,002 Points

Thank you so much! It seems I didn't follow that part of the video (5:30) :S my code lacked that single line so that's why the text color didn't change :)

alt text

I am glad it worked out for you! :-)