1
根據android documentation它具有完整的sqlite支持。這是否意味着我可以使用core functions作爲projection
一部分查詢,例如:Android SQLite核心功能
final ContentResolver cr = getContentResolver();
final String [] projection = new String []{
...,
...,
"replace(...) as replacedCol"
};
Cursor c = cr.query(uri, projection, null, null, null);
這個片段拋出IllegalArgumentException
(無效的列替換(...))。 那麼有沒有辦法在sqlite查詢中使用核心功能?
編輯錯誤很可能是由ContentProvider引起的,它檢查允許的列,所以看起來使用帶有內容解析器的函數是不可能的。
是你的ContentProvider嗎? – Selvin
所以這是不可能的...但...假設你使用列表視圖/微調你可以建立你的自定義適配器,並在設置查看前替換此字符串(在getView或bindView) – Selvin
@Selvin不,它是ContactsContract提供商 – Vladimir