81
CHAPTER 6: Content Providers
delete(url: Uri, where: String, selectionArgs: Array): Int
This deletes records.
update(uri: Uri, values: ContentValues, where: String,
selectionArgs: Array): Int
This updates records.
query(uri: Uri, projection: Array, queryArgs: Bundle,
cancellationSignal: CancellationSignal): Cursor
This queries content according to the parameters given.
query(uri: Uri, projection: Array, selection:
String, selectionArgs: Array, sortOrder: String,
cancellationSignal: CancellationSignal): Cursor
This queries content according to the parameters given.
query(uri: Uri, projection: Array, selection: String,
selectionArgs: Array, sortOrder: String): Cursor
This queries content according to the parameters given.
Their signatures and meanings closely relate to the corresponding ContentProvider
methods, as covered earlier. Also, take a look at the online API reference.
To instead access file content, you can use one of the following methods:
openAssetFileDescriptor(uri: Uri, mode: String,
cancellationSignal: CancellationSignal): AssetFileDescriptor
This opens the inner (asset) file.
openAssetFileDescriptor(uri: Uri, mode: String):
AssetFileDescriptor
This opens the inner (asset) file, with no cancellation signal.
openTypedAssetFileDescriptor(uri: Uri, mimeType: String,
opts: Bundle, cancellationSignal: CancellationSignal):
AssetFileDescriptor
This opens the typed inner (asset) file.
openTypedAssetFileDescriptor(uri: Uri, mimeType: String, opts:
Bundle): AssetFileDescriptor
This opens the typed inner (asset) file, with no cancellation signal.
openFileDescriptor(uri: Uri, mode: String, cancellationSignal:
CancellationSignal): ParcelFileDescriptor
This opens the file.
openFileDescriptor(uri: Uri, mode: String): ParcelFileDescriptor
This opens the file, with no cancellation signal.
Do'stlaringiz bilan baham: |