Code example for UriMatcher

Methods: addURImatch

0
 
	public static final String NoOpCommand_PATH_EXT = "no";	
 
	 
	public void testUriMatcher() { 
		UriMatcher m = new UriMatcher(UriMatcher.NO_MATCH);
		 
		String auth = "sqleasy";
		 
		Uri uri2 = Uri.parse( "content://sqleasy/uri/10" );
		 
		String path2 = "uri/#";
 
		m.addURI(auth, path2, 1);
		 
		 
		Uri uri = Uri.parse( "content://sqleasy/uri" );
		 
		String path = uri.getPath();
			 
		m.addURI(auth, "uri", 2);
 
		int match = m.match( uri );
		int match2 = m.match( uri2 );
		 
		assertEquals(2, match);
		assertEquals(1, match2);
	}