+ private SimpleCursorAdapter mForecastAdapter;
+
+ private static final int FORECAST_LOADER = 0;
+ private String mLocation;
+
+ // For the forecast view we're showing only a small subset of the stored data.
+ // Specify the columns we need.
+ private static final String[] FORECAST_COLUMNS = {
+ // In this case the id needs to be fully qualified with a table name, since
+ // the content provider joins the location & weather tables in the background
+ // (both have an _id column)
+ // On the one hand, that's annoying. On the other, you can search the weather table
+ // using the location set by the user, which is only in the Location table.
+ // So the convenience is worth it.
+ WeatherEntry.TABLE_NAME + "." + WeatherEntry._ID,
+ WeatherEntry.COLUMN_DATETEXT,
+ WeatherEntry.COLUMN_SHORT_DESC,
+ WeatherEntry.COLUMN_MAX_TEMP,
+ WeatherEntry.COLUMN_MIN_TEMP,
+ LocationEntry.COLUMN_LOCATION_SETTING
+ };
+
+ // These indices are tied to FORECAST_COLUMNS. If FORECAST_COLUMNS changes, these
+ // must change.
+ public static final int COL_WEATHER_ID = 0;
+ public static final int COL_WEATHER_DATE = 1;
+ public static final int COL_WEATHER_DESC = 2;
+ public static final int COL_WEATHER_MAX_TEMP = 3;
+ public static final int COL_WEATHER_MIN_TEMP = 4;
+ public static final int COL_LOCATION_SETTING = 5;