Created
December 29, 2016 11:36
-
-
Save AntonioDiaz/2ee841e42a1708038f034b7a92564348 to your computer and use it in GitHub Desktop.
UriMatcher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WeatherProvider extends ContentProvider { | |
// The URI Matcher used by this content provider. | |
private static final UriMatcher sUriMatcher = buildUriMatcher(); | |
static UriMatcher buildUriMatcher() { | |
final UriMatcher uriMatcher = new UriMatcher(UriMatcher.NO_MATCH); | |
final String authority = WeatherContract.CONTENT_AUTHORITY; | |
uriMatcher.addURI(authority, WeatherContract.PATH_WEATHER, WEATHER); | |
uriMatcher.addURI(authority, WeatherContract.PATH_WEATHER + "/*", WEATHER_WITH_LOCATION); | |
uriMatcher.addURI(authority, WeatherContract.PATH_WEATHER + "/*/#", WEATHER_WITH_LOCATION_AND_DATE); | |
uriMatcher.addURI(authority, WeatherContract.PATH_LOCATION, LOCATION); | |
return uriMatcher; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment