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 Android Lists and Adapters (2015) Standard ListViews Introducing ListView and ListActivity

Elijah Wendel
Elijah Wendel
2,590 Points

Content.xml and List Views

I have been doing this course on making the stormy application with the newest Android Studio version, and I was a little confused because my Activity.xml wasn't working. I figured out I was supposed to use the Content.xml so I have been using that. Am I really supposed to use the Content.xml layout?

I started the part 2 for the stormy course. Everything has been working fine until I came upon the List Views. First of all, I made the new activity. In the content_daily_forecast.xml, I had a little (I think it's called floatingActionButton) button which I could not delete. Furthermore after I made the new activity, inside the DailyForecastActivity.java, I had to change: "public class DailyForecastActivity extends AppCompatActivity {..........}" to "public class DailyForecastActivity extends ListActivity {.........}" and some code was marked with an error.

This is my code and the information which I will mark in between two !!!!! is where the errors are:

public class DailyForecastActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_daily_forecast);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        !!!!! setSupportActionBar !!!!! (toolbar);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });
        !!!!! getSupportActionBar !!!!! ().setDisplayHomeAsUpEnabled(true);
    } 
}

Can someone help me fix these errors and also to delete that little round "floatingActionButton"?

Thank you!