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.

Android

Joyce Chidiadi
Joyce Chidiadi
1,867 Points

My app stops and my images are not showing by the side of the Show Intent Guide / Show LineNumber panel on the left.

I am using different images from the ones for the tutorial, but my app keeps crashing on the tap of the button and my images do not show by the side of the Show Intent Guide / Show LineNumber panel on the left like in the video.

Here is my code for the story class: public class Story { private Page[] Pages;

public Story() {
    Pages = new Page[7];
    Pages[0] = new Page(
            R.drawable.abundance,
            "Do not worry",
            new Choice("Stop and Reason", 1),
            new Choice("All will be Well", 2));

    Pages[1] = new Page(R.drawable.awesome,
            "You deftly land your ship near where the distress signal originated. You didn't notice anything strange on your fly-by, but there is a cave in front of you. Behind you is an abandoned rover from the early 21st century.",
            new Choice("Explore the cave", 3),
            new Choice("Explore the rover", 4));

    Pages[2] = new Page(
            R.drawable.awesome,
            "You continue your course to Earth. Two days later, you receive a transmission from HQ saying that they have detected some sort of anomaly on the surface of Mars near an abandoned rover. They ask you to investigate, but ultimately the decision is yours because your mission has already run much longer than planned and supplies are low.",
            new Choice("Head back to Mars to investigate", 4),
            new Choice("Continue home to Earth", 6));

    Pages[3] = new Page(
            R.drawable.awesome,
            "Your EVA suit is equipped with a headlamp, which you use to navigate the cave. After searching for a while your oxygen levels are starting to get pretty low. You know you should go refill your tank, but there's a very faint light up ahead.",
            new Choice("Refill at ship and explore the rover", 4),
            new Choice("Continue towards the faint light", 5));

    Pages[4] = new Page(
            R.drawable.awesome,
            "The rover is covered in dust and most of the solar panels are broken. But you are quite surprised to see the on-board system booted up and running. In fact, there is a message on the screen: \"%1$s, come to 28.543436, -81.369031.\" Those coordinates aren't far, but you don't know if your oxygen will last there and back.",
            new Choice("Explore the coordinates", 5),
            new Choice("Return to Earth", 6));

    Pages[5] = new Page(
            R.drawable.awesome,
            "After a long walk slightly uphill, you end up at the top of a small crater. You look around, and are overjoyed to see your favorite android, %1$s-S1124. It had been lost on a previous mission to Mars! You take it back to your ship and fly back to Earth.");

    Pages[6] = new Page(
            R.drawable.awesome,
            "You arrive home on Earth. While your mission was a success, you forever wonder what was sending that signal. Perhaps a future mission will be able to investigate...");
}

public Page getPage(int pageNumber) {
    return Pages[pageNumber];
}


}

Please help. Thank you.