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 trialRamy Elsaraf
7,633 PointsI get a nullpointerexception when I add finally mTransitionManager.transitionTo(mCurrentScene); sthing wrong withis l
something wrong with the above line
Jasmeet Singh
20,145 PointsDid you called the setUpTransitions method in onCreate of the activity?
2 Answers
Christina Campbell
12,098 PointsI am having the same problem. Would love to know why.
here is my code:
public void onButtonClicked(View view) { if (mCurrentScene == mScene2) { mCurrentScene = mScene1; } else { mCurrentScene = mScene2; }
mTransitionManager.transitionTo(mCurrentScene);
}
protected void setupTransitions() {
// These methods are setting up scenes and transitions sets like in the video
initScenes();
initSets();
// Start here!
TransitionManager mTransitionManager = new TransitionManager();
mTransitionManager.setTransition(mScene1, mScene2, mForwardSet);
mTransitionManager.setTransition(mScene2, mScene1, mBackwardSet);
mScene1.enter();
}
}
Jasmeet Singh
20,145 PointsDon't create another mTransitionManger object it's already declared. Just use it.
Ramy Elsaraf
7,633 PointsmTransitionManager is declared twice for me
Seth Kroger
56,413 PointsSeth Kroger
56,413 PointsCan you show us your code? I will help a lot in figuring out what's going on.