Hi there,

I do not understand the URIMatcher class at all, neither from the
android documentation as well.  Is the purpose of this class to figure
out if a content provider can handle a particular MIMETYPE?  I take it
that this comes into play only if the CONTENT_URI has matched the
content provider's? Is this a secondary check?  I'm also unsure of the
usage of static { ....} feature of Java.  I have not seen that before.

    static {
        sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
        sUriMatcher.addURI(NotePad.AUTHORITY, "notes", NOTES);
        sUriMatcher.addURI(NotePad.AUTHORITY, "notes/#", NOTE_ID);

        sNotesProjectionMap = new HashMap<String, String>();
        sNotesProjectionMap.put(Notes._ID, Notes._ID);
        sNotesProjectionMap.put(Notes.TITLE, Notes.TITLE);
        sNotesProjectionMap.put(Notes.NOTE, Notes.NOTE);
        sNotesProjectionMap.put(Notes.CREATED_DATE,
Notes.CREATED_DATE);
        sNotesProjectionMap.put(Notes.MODIFIED_DATE,
Notes.MODIFIED_DATE);
    }

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to