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 trialQuintin Marcelino
2,693 PointsCompiler Error creating new scene for transition animation (but no Preview button to see the error in the challenge)
This code challenge is throwing me an error, and I'm not sure why. Since there's no preview button, I can't see what exactly is throwing the error. Any idea what may be throwing the error? Thanks in advance!
// Add your code below!
ViewGroup root = (ViewGroup) findViewById(R.id.container);
Scene newScene = Scene.getSceneLayout(root, R.layout.transition_scene_2, view.getContext());
1 Answer
Simon Coates
28,694 PointsI couldn' get a preview button either. The following code passed:
ViewGroup root = (ViewGroup) findViewById(R.id.container);
Scene newScene = Scene.getSceneForLayout(root, R.layout.transition_scene_2, this.getContext());
I feel like there's context missing in the explanation.
Quintin Marcelino
2,693 PointsQuintin Marcelino
2,693 PointsAwesome, that definitely works. I feel like there's a bit of context missing too, but I get it now. Thanks!