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
Mike Costa
Courses Plus Student 26,362 PointsCode Challenge: Adding Data for the List error!!
Happy Holidays everyone! :)
So I'm going over the Android "Rebuilding from Scratch" lessons, and I ran into an error on the first task of this code challenge. I'm 99% sure this is correct but I figured I'd post my code here to see if anyone can point out if I'm doing something wrong, or there is an error in the compiling engine of treehouse for this challenge.
package com.example;
import android.app.ListActivity; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter;
public class MainListActivity extends ListActivity {
public String[] mSongTitles = { "1", "2", "3" };
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_list);
}
}
(EDIT: This is the error I get "Bummer! Compilation Error! Make sure 'mSongTitles' is declared inside the curly braces of MainListActivity before the 'onCreate()' method.")
5 Answers
Ben Jakuben
Treehouse TeacherSorry about that! It looks like there's an error with the Code Challenge. I'll try to get it fixed tomorrow morning and post back in here.
Nicholas Wimsatt
Courses Plus Student 1,086 PointsThanks for posting this. I got a compilation error on the same challenge.
public String[] mSongTitles = { "a", "b", "c"};
Jed Carey
12,678 PointsSame here.
Carlos Dominguez Padron
1,194 PointsI would like to finish my code challenge :-(
When this bug is going to be fixed?
Ben Jakuben
Treehouse TeacherSo sorry everyone - the fix will be up this morning!
UPDATE Fixed and verified! Happy coding!