UriMatcher赢了

时间:2015-02-23 17:16:23

标签: android uri android-contentprovider

我创建的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

0 个答案:

没有答案