Code example for UriMatcher

Methods: addURI

0
 
    private DbCityDatabaseHelper mOpenHelper;
 
    private static final int CITIES = 1;
    private static final int CITIES_ID = 2;
    private static final UriMatcher sURLMatcher = new UriMatcher(
            UriMatcher.NO_MATCH);
 
    static { 
        sURLMatcher.addURI("com.android.deskclock.worldclock.db", "city", CITIES);
        sURLMatcher.addURI("com.android.deskclock.worldclock.db", "city/#", CITIES_ID);
    } 
 
    public DbCityProvider() { 
    } 
 
    @Override 
    public boolean onCreate() { 
        mOpenHelper = new DbCityDatabaseHelper(getContext());
        return true; 
Contextual code suggestions in your IDE  Get Codota for Java