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 Animations and Transitions The Transitions Framework Create a Transition

I am not understanding what I am doing wrong please help I have been stuck on this for weeks!! :(

Scene ViewGroup = Scene.getSceneForLayout(transitionRoot, R.layout.transition_scene_2, view.getContext());

CodeChallenge.java
// Add your code below!

Scene ViewGroup = Scene.getSceneForLayout(transitionRoot,
        R.layout.transition_scene_2, view.getContext());

1 Answer

Kourosh Raeen
Kourosh Raeen
23,733 Points

Hi Phillip - We don't have a variable called transitionRoot. However, in the code given we have the variable root which refers to the root of the view hierarchy. We also don't have a variable called view so we can't call getContext() on that. Here's the code:

// Add your code below!
ViewGroup root = (ViewGroup) findViewById(R.id.container);
Scene ViewGroup = Scene.getSceneForLayout(root, R.layout.transition_scene_2, getContext());