ContentResolver是經過URI來查詢ContentProvider中提供的數據。除了URI以 外,還必須知道須要獲取的數據段的名稱,以及此數據段的數據類型。ide
若是你須要獲取一個特定的記錄,你就必須知道當前記錄的ID。 函數
簡要介紹ContentResolver的主要接口,以下: url
返回值 | 函數聲明 |
final Uri | insert (Uri url, ContentValues values) Inserts a row into a table at the given URL. |
final int | delete (Uri url, String where, String[] selectionArgs) Deletes row(s) specified by a content URI. |
final Cursor | query (Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) Query the given URI, returning a Cursor over the result set. |
final int | update (Uri uri, ContentValues values, String where, String[] selectionArgs) Update row(s) in a content URI. |