package com.example.android.sunshine;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBarActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.container, new PlaceholderFragment())
                    .commit();
        }


    }

    /**
     * A placeholder fragment containing a simple view.
     */
    public static class PlaceholderFragment extends Fragment {

        public PlaceholderFragment() {
        }

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                 Bundle savedInstanceState) {
            View rootView = inflater.inflate(R.layout.fragment_main, container, false);
            return rootView;
        }
    }


}

@@ -240,16 +240,161 @@
 ewGroup;
+%0Aimport android.widget.ArrayAdapter;%0Aimport android.widget.ListView;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.List;
 %0A%0Apublic
@@ -957,24 +957,72 @@
 Fragment %7B%0A%0A
+        ArrayAdapter%3CString%3E mForecastAdapter;%0A%0A
         publ
@@ -1210,32 +1210,33 @@
 nstanceState) %7B%0A
+%0A
             View
@@ -1303,24 +1303,1426 @@
 er, false);%0A
+%0A            // Create some dummy data for the ListView.  Here's a sample weekly forecast%0A            String%5B%5D data = %7B%0A                    %22Mon 6/23%E2%80%82- Sunny - 31/17%22,%0A                    %22Tue 6/24 - Foggy - 21/8%22,%0A                    %22Wed 6/25 - Cloudy - 22/17%22,%0A                    %22Thurs 6/26 - Rainy - 18/11%22,%0A                    %22Fri 6/27 - Foggy - 21/10%22,%0A                    %22Sat 6/28 - TRAPPED IN WEATHERSTATION - 23/18%22,%0A                    %22Sun 6/29 - Sunny - 20/7%22%0A            %7D;%0A            List%3CString%3E weekForecast = new ArrayList%3CString%3E(Arrays.asList(data));%0A%0A%0A            // Now that we have some dummy forecast data, create an ArrayAdapter.%0A            // The ArrayAdapter will take data from a source (like our dummy forecast) and%0A            // use it to populate the ListView it's attached to.%0A            mForecastAdapter =%0A                new ArrayAdapter%3CString%3E(%0A                    getActivity(), // The current context (this activity)%0A                    R.layout.list_item_forecast, // The name of the layout ID.%0A                    R.id.list_item_forecast_textview, // The ID of the textview to populate.%0A                    weekForecast);%0A%0A            // Get a reference to the ListView.%0A            ListView listView = (ListView) rootView.findViewById(R.id.listview_forecast);%0A            // Attach this adapter to it.%0A            listView.setAdapter(mForecastAdapter);%0A%0A
             
@@ -2738,16 +2738,17 @@
 otView;%0A
+%0A
         

Use an ArrayAdapter to populate the ListView.