0
我爲我的內容提供者構建了uriPatternMatcher。
我的uri就像我使用Logger語句的content://com.example.wordapp/wordlist?flashid=1
。 什麼應該是我的模式匹配器?查詢參數建設Uri匹配器
我試圖
public static final String CONTENT_AUTHORITY ="com.example.wordapp";
public static final Uri BASE_CONTENT_URI =Uri.parse("content://"+CONTENT_AUTHORITY);
public static final String PATH_WORD ="wordlist";
public static final String FLASHCARD_ID="flashid";
matcher.addURI(authority, WordContractClass.PATH_WORD + "?"+ WordContractClass.WordListEntry.FLASHCARD_ID+"=#", WORD_WITH_FLASH_LIST);
匹配器被示出作爲未找到匹配項輸出。
我想獲取具有相同flashId的所有條目。如果我將路徑(/)追加到我的uri中,而不是追加查詢(?),那麼您的答案可行。 – Ayush
你不應該在你的uri查詢 - 這是Android的設計。它在這方面沒有任何用處 – ucsunil