Pro Android with Kotlin


CHAPTER 6: Content Providers


Download 5.42 Mb.
Pdf ko'rish
bet76/223
Sana04.11.2023
Hajmi5.42 Mb.
#1746807
1   ...   72   73   74   75   76   77   78   79   ...   223
Bog'liq
@de android telegram Pro Android with Kotlin Developing Modern Mobile

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.



Download 5.42 Mb.

Do'stlaringiz bilan baham:
1   ...   72   73   74   75   76   77   78   79   ...   223




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling