Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Simple Android App (retired 2014) Shaking Things Up The Activity Lifecycle

2nd question of quiz

Next, change the word 'UNKNOWN' in the aString variable to either 'BEFORE' or 'AFTER'. The otherString variable mentioned in the sentence is declared and set in the onCreate() method of the parent class of this MainActivity. You want the sentence to be true, so choose the correct word knowing that otherString is set in the parent onCreate() method.

i'm not able to understand the question!

2 Answers

Rajesh Mule
Rajesh Mule
2,125 Points

aString = "This variable is set AFTER the 'otherString' variable in Activity";

Andrew McCormick
Andrew McCormick
17,730 Points

It's asking you to decide if the aString variable is set before or after the 'otherString' variable in the onCreate method of the parent class.
Look at the order of where the aString is set versus when the super.OnCreate() method is called.
All you are going to do in this step is simply replace the word "UNKNOWN" with "BEFORE" or 'AFTER' depending on the aString variable's relation to the super.onCreate() call.