public void onLocationChanged(String newLocation) { Uri uri = mUri; if (null != uri) { long date = WeatherContract.WeatherEntry.getDateFromUri(uri); Uri updateUri = WeatherContract.WeatherEntry.buildWeatherLocationWithDate(newLocation, date); mUri = updateUri; getLoaderManager().restartLoader(DETAIL_LOADER, null, this); } }
private Cursor getWeatherByLocationSettingAndDate( Uri uri, String[] projection, String sortOrder) { String locationSetting = WeatherContract.WeatherEntry.getLocationSettingFromUri(uri); long date = WeatherContract.WeatherEntry.getDateFromUri(uri); return sWeatherByLocationSettingQueryBuilder.query( mOpenHelper.getReadableDatabase(), projection, sLocationSettingAndDaySelection, new String[] {locationSetting, Long.toString(date)}, null, null, sortOrder); }