.buildWeatherUriWithDate(SunshineDateUtils.normalizeDate(System.currentTimeMillis()));
.buildWeatherUriWithDate(SunshineDateUtils.normalizeDate(System.currentTimeMillis()));
String selection = WeatherContract.WeatherEntry.getSqlSelectForTodayOnwards();
String selection = WeatherContract.WeatherEntry.getSqlSelectForTodayOnwards();
String selection = WeatherContract.WeatherEntry.getSqlSelectForTodayOnwards();
String selection = WeatherContract.WeatherEntry.getSqlSelectForTodayOnwards();
@Override public Void doInBackground( Void... voids ) { /* URI for every row of weather data in our weather table*/ Uri forecastQueryUri = WeatherContract.WeatherEntry.CONTENT_URI; String[] projectionColumns = {WeatherContract.WeatherEntry._ID}; String selectionStatement = WeatherContract.WeatherEntry .getSqlSelectForTodayOnwards(); /* Here, we perform the query to check to see if we have any weather data */ Cursor cursor = context.getContentResolver().query( forecastQueryUri, projectionColumns, selectionStatement, null, null); // COMPLETED (6) If it is empty or we have a null Cursor, sync the weather now! if (null == cursor || cursor.getCount() == 0) { startImmediateSync(context); } cursor.close(); return null; } }.execute();
/** * This method is for responding to clicks from our list. * * @param date Normalized UTC time that represents the local date of the weather in GMT time. * @see WeatherContract.WeatherEntry#COLUMN_DATE */ @Override public void onClick(long date) { Intent weatherDetailIntent = new Intent(MainActivity.this, DetailActivity.class); Uri uriForDateClicked = WeatherContract.WeatherEntry.buildWeatherUriWithDate(date); weatherDetailIntent.setData(uriForDateClicked); startActivity(weatherDetailIntent); }
/** * This method is for responding to clicks from our list. * * @param date Normalized UTC time that represents the local date of the weather in GMT time. * @see WeatherContract.WeatherEntry#COLUMN_DATE */ @Override public void onClick(long date) { Intent weatherDetailIntent = new Intent(MainActivity.this, DetailActivity.class); Uri uriForDateClicked = WeatherContract.WeatherEntry.buildWeatherUriWithDate(date); weatherDetailIntent.setData(uriForDateClicked); startActivity(weatherDetailIntent); }
/** * This method is for responding to clicks from our list. * * @param date Normalized UTC time that represents the local date of the weather in GMT time. * @see WeatherContract.WeatherEntry#COLUMN_DATE */ @Override public void onClick(long date) { Intent weatherDetailIntent = new Intent(MainActivity.this, DetailActivity.class); Uri uriForDateClicked = WeatherContract.WeatherEntry.buildWeatherUriWithDate(date); weatherDetailIntent.setData(uriForDateClicked); startActivity(weatherDetailIntent); }
.buildWeatherUriWithDate(SunshineDateUtils.normalizeDate(System.currentTimeMillis()));
.buildWeatherUriWithDate(SunshineDateUtils.normalizeDate(System.currentTimeMillis()));
.buildWeatherUriWithDate(SunshineDateUtils.normalizeDate(System.currentTimeMillis()));
.buildWeatherUriWithDate(SunshineDateUtils.normalizeDate(System.currentTimeMillis()));
.buildWeatherUriWithDate(SunshineDateUtils.normalizeDate(System.currentTimeMillis()));
.buildWeatherUriWithDate(SunshineDateUtils.normalizeDate(System.currentTimeMillis()));
.buildWeatherUriWithDate(SunshineDateUtils.normalizeDate(System.currentTimeMillis()));
.buildWeatherUriWithDate(SunshineDateUtils.normalizeDate(System.currentTimeMillis()));
.buildWeatherUriWithDate(SunshineDateUtils.normalizeDate(System.currentTimeMillis()));