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 Build an Interactive Story App (Retired) Intents and Multiple Activities Adding a Second Activity

Xaralampos Kanellopoulos
Xaralampos Kanellopoulos
5,567 Points

App crashes when i press the Button

When i press the button the app crashes any idea why this is happening? The code in MainActivity is from the Project files.. I am using the latest version of Android Studio/

Xaralampos Kanellopoulos
Xaralampos Kanellopoulos
5,567 Points

I fixed it by commenting //getSupportActionBar().setDisplayHomeAsUpEnabled(true); in StoryActivity any idea why this was a fault? Thnx

2 Answers

Hi Xaralampos,

I think it might be that you have deleted all the other code for the task bar, but missed that line of code, forcing the app to crash because it didn't know what to do with it.

Andrew Wiley
Andrew Wiley
27,097 Points

If you put a name in and then press the button, you will get an error... if you dont and press the button it will work