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

Android Build a Blog Reader Android App Getting Data from the Web Trying Code and Catching Exceptions

Android Blog Reader Challenge(PLEASE HELP!!!!!!!!!)

Need help!! Declare a constant String variable named URL and set it to "teamtreehouse.com". Declare it as a static constant like we saw in the video. Thank you!

You did not add enough "!" hence why you did not get an answer on time ;)

6 Answers

very close :) it should be:

public static final String URL ="teamtreehouse.com";

Sorry if i mislead you with my parenthesis.

And don't forget you need to add it outside of the onCreate() method.

Hi Papaijas,

public static final String = (I'll leave the rest to you :) )

Am I even close? public static final String = (teamtreehouse.com);

What needs to be added is

public static final String URL ="teamtreehouse.com";

It needs to be added outside of the onCreate() method. Which means that this is how the entire file looks

package com.example;

import android.os.Bundle;
import android.view.View;
import java.net.MalformedURLException;
import android.util.Log;



public class MainListActivity extends ListActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_list);

        // Add Task 2 code here

    }
    public static final String URL ="teamtreehouse.com";
}

It worked for me. But can you briefly explain why we add it outside the method at the bottom? Thank you

.

Thank you!:)