1.初始化
UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);
2.注册
matcher.addURI("vnd.android.cursor.item", "email_v2",9);
matcher.addURI("vnd.android.cursor.item", "im", 2);
matcher.addURI("vnd.android.cursor.item", "postal-address_v2", 3);
matcher.addURI("vnd.android.cursor.item", "photo", 4);
matcher.addURI("vnd.android.cursor.item", "phone_v2", 5);
matcher.addURI("vnd.android.cursor.item", "name", 6);
matcher.addURI("vnd.android.cursor.item", "organization", 7);
matcher.addURI("vnd.android.cursor.item", "nickname", 8);
matcher.addURI("vnd.android.cursor.item", "group_membership", 9);
3匹配.
mimetype_id = matcher.match(Uri.parse("content://"+mimetype));
System.out.println("MIMETYPE_ID---"+mimetype_id);
红色字体部分必须加,开始以为只是匹配字符串,然后一直不成功