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 trialPatrick Munemo
14,892 PointsTransitions postponement
The Activity below is displaying images downloaded from the internet. Postpone the enter transition for this activity until the images are downloaded and set, which happens in the initViews() method.
public class MainActivity extends Activity {
// Some code omitted for brevity!
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_album_detail);
setupTransitions();
initViews{postponeEnterTransition()};
}
public void setupTransitions() {
// (Omitted) Code to set up transitions...
}
public void initViews() {
// (Omitted) Code to initialize all views in the Activity...
}
}
Patrick Munemo
14,892 PointsBen Jakuben please help me
2 Answers
Ben Jakuben
Treehouse TeacherAlright, let's check out this line:
initViews{postponeEnterTransition()};
First, you've added curly braces instead of parentheses, which will give you a syntax error.
Second, if you look at the definition for initView()
, you'll see that it doesn't take any parameters, so you wouldn't want to add postponeEnterTransition()
or anything else in there.
So you'll need to change that line back to its original form: initViews();
Then, you are on the right track with using postponeEnterTransition()
--you just need to call it in the right place. Here's your hint: You want to call this method as the transitions are being setup.
Patrick Munemo
14,892 PointsThanks very much, i was getting worried with this challenge.
Glen Chiridza
8,441 PointspostponeEnterTransition(); had to be simply called in the setupTransition method!
Patrick Munemo
14,892 PointsPatrick Munemo
14,892 PointsPlease can anyone help me am stuck Ben Deitch