在对我之前的一个问题的回答中,有人表示Android类UriMatcher中存在一些固有的缺陷(缺乏一个更好的词).任何人都可以通过UriMatcher查明已知问题吗?我正在设计一个依赖于UriMatcher的内容提供程序来正确匹配我的Uris(而不是我猜错了).是否存在已知问题的解决方法?或者是否有更好的匹配Uris的策略?
例:
这是我的UriMatcher的代码设置
private static final int MEMBER_COLLECTION_URI = 1;
private static final int MEMBER_SINGLE_URI = 2;
private static final int SUBMATERIAL_COLLECTION_URI = 3;
private static final int SUBMATERIAL_SINGLE_URI = 4;
private static final int JOBNAME_COLLECTION_URI = 5;
private static final int JOBNAME_SINGLE_URI = 6;
private static final int ALL_MEMBERS_URI = 7;
private static final int ALL_SUBMATERIAL_URI = 8;
static
{
//return the job and fab for anything matching the provided jobName
// JobNames/jobName
uriMatcher.addURI(JobMetaData.AUTHORITY, "JobNames/*/",
JOBNAME_SINGLE_URI);
//return a collection …Run Code Online (Sandbox Code Playgroud)