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 a Simple Android App Improving Our Code Dynamically Changing the Background Color

Austin Garrison
Austin Garrison
9,692 Points

App crashes after assigning view to variable

The app works fine up until I add mRelativeLayout = (RelativeLayout) findViewById(R.id.relativeLayout); the app then crashes and wont open again. the id under .xml is android:id="@+id/relativeLayout"

Austin Garrison
Austin Garrison
9,692 Points

Fixed it on my own.... Replaced anything that says RelativeLayout with ConstraintLayout.

These videos need to be updated..

@Austin Garrison Thank you for posting your solution, I had the exact same problem and replacing all traces of "relative" with "constraint" did the trick. I had noticed at the very beginning that they were different but I didn't think anything of it and then when I got to this part I thought my computer was broken!

Kerry Smyth
Kerry Smyth
3,921 Points

Thanks Austin Garrison! The course certainly does need to be updated. TeamTreeHouse should add text over the top like in YouTube clips at least warning of the changes. Wasting my time.