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
Siddharth Saravanan
1,208 PointsUnfortunately, Crystal ball has stopped. Please help.
When I start my app on the emulator, I get the message, "Unfortunately, Crystal ball has stopped". I have done everything correctly and I followed the instructions right. This is the line of code that logcat tells me is the problem
final TextView answerLabel = (TextView) findViewById(R.id.textView1);
This line of code is in the mainactivity.java file. If anyone can help me solve this problem, it would be appreciated.
1 Answer
Tom Williams
7,473 PointsI would try this....
public class MainActivity extends Activity {
private TextView mYourVariableName;
}
protected void onCreate(your arguments) {
mYourVariableName = (TextView) findViewById(R.id.textView1);
}
It looks like the error being thrown is because either the final statement or it cant resolve the variable reference.
Siddharth Saravanan
1,208 PointsOk thx I tried it and it worked
J Andrew Scott
30,626 PointsJ Andrew Scott
30,626 PointsCould you post the rest of the logcat error? It's hard to guess what the problem is without debugging info.