Code example for UriMatcher

Methods: addURI

    private DbCityDatabaseHelper mOpenHelper;
    private static final int CITIES = 1;
    private static final int CITIES_ID = 2;
    private static final UriMatcher sURLMatcher = new UriMatcher(
    static { 
        sURLMatcher.addURI("", "city", CITIES);
        sURLMatcher.addURI("", "city/#", CITIES_ID);
    public DbCityProvider() { 
    public boolean onCreate() { 
        mOpenHelper = new DbCityDatabaseHelper(getContext());
        return true; 
Connect your IDE to all the code out there  Get Codota for Java