Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Issue in ForecastFragment FORECAST_COLUMNS and indices - Location_id column is missing #304

Open
nirthik opened this issue Oct 21, 2016 · 1 comment

Comments

@nirthik
Copy link

nirthik commented Oct 21, 2016

WeatherContract.WeatherEntry.COLUMN_LOC_KEY, is missing in FORECAST_COLUMNS columns.

In onCreateView Cursor cursor = (Cursor) adapterView.getItemAtPosition(position); the cursor returns the WeatherContract.WeatherEntry.COLUMN_LOC_KEY in second position and WeatherContract.WeatherEntry.COLUMN_DATE, in third position.

So the indices for the FORECAST_COLUMNS also need to be changed.

The following lines need to be added in ForecastFragment:

        WeatherContract.WeatherEntry.COLUMN_LOC_KEY,

static final int COL_LOCATION_ID = 1;
static final int COL_WEATHER_DATE = 2;

@aqib-git
Copy link

aqib-git commented Dec 10, 2016

I'm facing this issue also, I made FORECAST_COULMN public then did some refactoring in ForecastAdapter as given below


int dateInMillisIndex = cursor.getColumnIndex(ForecastFragment.FORECAST_COLUMNS[ForecastFragment.COL_WEATHER_DATE]);

long dateInMillis = cursor.getLong(dateInMillisIndex);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants