Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CallerIDProvider : ContentProvider() {
- private val uriMatcher = UriMatcher(UriMatcher.NO_MATCH)
- override fun onCreate(): Boolean {
- context?.let {
- val authority = it.getString(R.string.callerid_authority)
- uriMatcher.addURI(authority, "directories", DIRECTORIES)
- }
- return true
- }
- override fun query(uri: Uri, projection: Array<out String>?, selection: String?, selectionArgs: Array<out String>?, sortOrder: String?): Cursor? {
- when (uriMatcher.match(uri)) {
- DIRECTORIES -> { /* TODO */ }
- }
- return null
- }
- override fun getType(uri: Uri): String? {
- return null
- }
- override fun delete(uri: Uri, selection: String?, selectionArgs: Array<String>?): Int {
- throw UnsupportedOperationException()
- }
- override fun insert(uri: Uri, values: ContentValues?): Uri? {
- throw UnsupportedOperationException()
- }
- override fun update(uri: Uri, values: ContentValues?, selection: String?, selectionArgs: Array<String>?): Int {
- throw UnsupportedOperationException()
- }
- companion object {
- private const val DIRECTORIES = 1
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement