Android Build an Interactive Story App Finishing the User Interface Using a Model in the Presenter

spaceship issues

If youre reading this Treehouse, you're going downhill. The instructions on your code assignments are unclear at times and need revising.
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class LandingActivity extends AppCompatActivity {

    public Button thrustButton;
    public TextView typeLabel;
    public EditText passengersField;

    public Spaceship spaceship;

    public void onCreate(Bundle savedInstanceState) {

        thrustButton = (Button)findViewById(;
        typeLabel = (TextView)findViewById(;
        passengersField = (EditText)findViewById(;

        // Add your code here!
        spaceship = new Spaceship("FIREFLY");

public class Spaceship {
    private String shipType;
    private int numPassengers = 0;

    public String getShipType() {
      return shipType;

    public void setShipType(String shipType) {
      this.shipType = shipType;

    public int getNumPassengers() {
      return numPassengers;

    public void setNumPassengers(int numPassengers) {
      this.numPassengers = numPassengers;

    public Spaceship() {
      shipType = "SHUTTLE";

    public Spaceship(String shipType) {
      this.shipType = shipType;

1 Answer

Jennifer Nordell
Jennifer Nordell
Treehouse Teacher

Hi there, Alvaro Roa! This challenge has been around for a while :smiley: I'd be interested to know how you'd reword it, if you could. But the idea here is that you want to change the text on the text view which was assigned to the variable typeLabel. You can do that with the setText() method and passing in the result of getShipType().


Hope this helps! :sparkles: