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 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.