Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Barry Snowe
51,277 PointsWhy is this producing a compiler error?
I am pretty sure this should work. What will it take to get the compiler to recognize the dot operator symbol (if I understand the compiler error log correctly...)?
public class MealActivity extends Activity {
public TextView foodLabel;
public TextView drinkLabel;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_meal);
foodLabel = (TextView) findViewById(R.id.foodTextView);
drinkLabel = (TextView) findViewById(R.id.drinkTextView);
RelativeLayout mealLayout = (RelativeLayout) findViewById(R.id.mealLayout);
mealLayout.setBackgroundColor(Color.GREEN);
foodLabel.setBackgroundColor(Color.BLUE);
drinkLabel.setbackgroundColor(Color.GRAY);
}
}

Barry Snowe
51,277 PointsNever mind. I was mindlessly writing setBackgroundColor
when I needed to write setTextColor
. Problem existed between chair and keyboard.
1 Answer

Nkosinolwazi Moyo
9,588 Points☺
Barry Snowe
51,277 PointsBarry Snowe
51,277 PointsThis portion is my contribution to the challenge: