Example usage for android.content UriMatcher addURI

List of usage examples for android.content UriMatcher addURI

Introduction

In this page you can find the example usage for android.content UriMatcher addURI.

Prototype

public void addURI(String authority, String path, int code) 

Source Link

Document

Add a URI to match, and the code to return when this URI is matched.

Usage

From source file:com.jbirdvegas.mgerrit.database.Revisions.java

@SuppressWarnings("unused")
public static void addURIMatches(UriMatcher _urim) {
    _urim.addURI(DatabaseFactory.AUTHORITY, TABLE, ITEM_LIST);
    _urim.addURI(DatabaseFactory.AUTHORITY, TABLE + "/#", ITEM_ID);
}

From source file:com.jbirdvegas.mgerrit.database.FileChanges.java

public static void addURIMatches(UriMatcher _urim) {
    _urim.addURI(DatabaseFactory.AUTHORITY, TABLE, ITEM_LIST);
    _urim.addURI(DatabaseFactory.AUTHORITY, TABLE + "/#", ITEM_ID);
}

From source file:com.nononsenseapps.feeder.db.FeedItemSQL.java

public static void addMatcherUris(UriMatcher sURIMatcher) {
    sURIMatcher.addURI(RssContentProvider.AUTHORITY, URI_FEED_ITEMS.getPath(), URICODE);
    sURIMatcher.addURI(RssContentProvider.AUTHORITY, URI_FEED_ITEMS.getPath() + "/#", ITEMCODE);
}

From source file:fr.matthiasbosc.translucentmap.PlaceProvider.java

private static UriMatcher buildUriMatcher() {

    UriMatcher uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);

    // URI for "Go" button
    uriMatcher.addURI(AUTHORITY, "search", SEARCH);

    // URI for suggestions in Search Dialog
    uriMatcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY, SUGGESTIONS);

    // URI for Details
    uriMatcher.addURI(AUTHORITY, "details", DETAILS);

    return uriMatcher;
}

From source file:redgun.bakingapp.data.RecipesProvider.java

static UriMatcher buildUriMatcher() {
    // I know what you're thinking.  Why create a UriMatcher when you can use regular
    // expressions instead?  Because you're not crazy, that's why.

    // All paths added to the UriMatcher have a corresponding code to return when a match is
    // found.  The code passed into the constructor represents the code to return for the root
    // URI.  It's common to use NO_MATCH as the code for this case.
    final UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);
    final String authority = RecipesContract.CONTENT_AUTHORITY;

    // For each type of URI you want to add, create a corresponding code.
    matcher.addURI(authority, RecipesContract.PATH_RECIPE, RECIPES);
    return matcher;
}

From source file:com.google.android.apps.muzei.provider.MuzeiProvider.java

/**
 * Creates and initializes the URI matcher
 *
 * @return the URI Matcher/*ww  w.j  a v  a2 s  .  c o  m*/
 */
private static UriMatcher buildUriMatcher() {
    final UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);
    matcher.addURI(MuzeiContract.AUTHORITY, MuzeiContract.Artwork.TABLE_NAME, MuzeiProvider.ARTWORK);
    matcher.addURI(MuzeiContract.AUTHORITY, MuzeiContract.Artwork.TABLE_NAME + "/#", MuzeiProvider.ARTWORK_ID);
    matcher.addURI(MuzeiContract.AUTHORITY, MuzeiContract.Sources.TABLE_NAME, MuzeiProvider.SOURCES);
    matcher.addURI(MuzeiContract.AUTHORITY, MuzeiContract.Sources.TABLE_NAME + "/#", MuzeiProvider.SOURCE_ID);
    return matcher;
}

From source file:org.voidsink.anewjkuapp.fragment.AssessmentDetailFragment.java

@Override
public void onStart() {
    super.onStart();

    UriMatcher uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    uriMatcher.addURI(KusssContentContract.AUTHORITY, KusssContentContract.Assessment.PATH_CONTENT_CHANGED, 0);

    mObserver = new BaseContentObserver(uriMatcher, this);
    getActivity().getContentResolver()/*from   w  w w.  ja  va2s  .  c o m*/
            .registerContentObserver(KusssContentContract.Assessment.CONTENT_CHANGED_URI, false, mObserver);
}

From source file:org.voidsink.anewjkuapp.fragment.ExamFragment.java

@Override
public void onStart() {
    super.onStart();

    UriMatcher uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    uriMatcher.addURI(KusssContentContract.AUTHORITY, KusssContentContract.Exam.PATH_CONTENT_CHANGED, 0);

    mDataObserver = new BaseContentObserver(uriMatcher, this);
    getActivity().getContentResolver().registerContentObserver(KusssContentContract.Exam.CONTENT_CHANGED_URI,
            false, mDataObserver);/*from www.  j a  v a 2 s.  c o m*/
}

From source file:org.voidsink.anewjkuapp.fragment.StatFragmentDetail.java

@Override
public void onStart() {
    super.onStart();

    UriMatcher uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    uriMatcher.addURI(KusssContentContract.AUTHORITY, KusssContentContract.Course.PATH_CONTENT_CHANGED, 0);
    uriMatcher.addURI(KusssContentContract.AUTHORITY, KusssContentContract.Assessment.PATH_CONTENT_CHANGED, 1);

    mDataObserver = new BaseContentObserver(uriMatcher, this);
    getActivity().getContentResolver().registerContentObserver(KusssContentContract.Course.CONTENT_CHANGED_URI,
            false, mDataObserver);//from  www  .j av  a 2s  .c o  m
    getActivity().getContentResolver()
            .registerContentObserver(KusssContentContract.Assessment.CONTENT_CHANGED_URI, false, mDataObserver);

    PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
}

From source file:org.voidsink.anewjkuapp.fragment.LvaDetailFragment.java

@Override
public void onStart() {
    super.onStart();

    UriMatcher uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    uriMatcher.addURI(KusssContentContract.AUTHORITY, KusssContentContract.Course.PATH_CONTENT_CHANGED, 0);
    uriMatcher.addURI(KusssContentContract.AUTHORITY, KusssContentContract.Assessment.PATH_CONTENT_CHANGED, 1);

    mLvaObserver = new BaseContentObserver(uriMatcher, this);
    getActivity().getContentResolver().registerContentObserver(KusssContentContract.Course.CONTENT_CHANGED_URI,
            false, mLvaObserver);//from   w  w w .  ja  v  a2 s  .  c  o m
    getActivity().getContentResolver()
            .registerContentObserver(KusssContentContract.Assessment.CONTENT_CHANGED_URI, false, mLvaObserver);

    PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
}