我创建的URI为content://com.freshfase.provider.MBoardGetDetailProvider/mboard_get_student_by_section_detail/a/b
使用:
Uri uri1 = Uri.withAppendedPath(MBoardGetDetailProvider.GET_STUDENT_DETAIL_BY_SECTION_URI, "a");
Uri uri2 = Uri.withAppendedPath(uri1, "b");
在ContentProvider
我使用:
public static final int GET_STUDENT_DETAIL_BY_SECTION = 5;
public static final Uri GET_STUDENT_DETAIL_BY_SECTION_URI = Uri.parse("content://" + PROVIDER_NAME + "/mboard_get_student_by_section_detail");
uriMatcher.addURI(PROVIDER_NAME, "mboard_get_student_by_section_detail/*/*", GET_STUDENT_DETAIL_BY_SECTION);
在打电话的时候:
int uriType = uriMatcher.match(uri);
我希望uriType
值为5但返回-1
。