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
Nursen Ablay
1,330 PointsStuck on Code challenge; Trying Code and Catching Exceptions, object 1
Bummer! Compilation Error! Declare "URL" above the "onCreate()" method, and remember that constant values are declared using "public static final <data type>".
package com.example;
import android.os.Bundle;
import android.view.View;
import java.net.MalformedURLException;
import android.util.Log;
public class MainListActivity extends ListActivity
public class String URL = teamtreehouse.com
{
@Override
public class String URL(teamtreehouse.com)
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_list);
2 Answers
Ernest Grzybowski
Treehouse Project ReviewerHey Nursen Ablay, I'm more than happy to help you. There's a couple of things wrong with your code, and a couple of things you probably want to review before you go any further in Android development.
- Your URL variable is outside of the class (should be inside)
- You need to follow the directions of the compilation error ("public static final")
- Your URL variable doesn't have any quotes and is missing an
; - You are missing a few closing brackets
}(you might have left them out intentionally)
This should be a fairly routine variable declaration at this point of the Android tutorials, but it seems like you need more help with some of the Java basics. I would try going back to some of the very first Android videos that explain what a string is, and maybe try looking up the Java tutorials from Oracle: http://docs.oracle.com/javase/tutorial/java/
Nursen Ablay
1,330 PointsThanx and yes I am a newbie when it becomes to developement. i already fixed this object but again thanx for your effort.