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'm completely stuck on the challenge after the "Formatting Strings" video in "Build an Interactive Story App".

I've done the first step, but I have no idea what to do in the second step. Any help would be appreciated. Thanks.

2 Answers

Solution for all 3 challenges is:

//setup new spaceship object  
        mSpaceship = new Spaceship("FIREFLY");

//set the text for the mTypeLabel TextView by using Spaceship's type  
      mTypeLabel.setText(mSpaceship.getType());

//store the number of passengers in the ship...
      mPassengersField.setText("" + mSpaceship.getNumPassengers());

The objective: You need to set the text for the mTypeLabel TextView using the Spaceship model's getType() function to get the type.

Try to figure it out on your own!

-

-

-

-

-

-

-

-

If you still get stuck, here's the solution:

mTypeLabel.setText(mSpaceship.getType());

Thank you. I just figured it out on my own right before I saw your reply. Sometimes walking away from the computer for a short while really helps out.