SHARE
TWEET

Untitled

a guest Sep 11th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class CallerIDProvider : ContentProvider() {
  2.   private val uriMatcher = UriMatcher(UriMatcher.NO_MATCH)
  3.   override fun onCreate(): Boolean {
  4.     context?.let {
  5.       val authority = it.getString(R.string.callerid_authority)
  6.       uriMatcher.addURI(authority, "directories", DIRECTORIES)
  7.     }
  8.     return true
  9.   }
  10.   override fun query(uri: Uri, projection: Array<out String>?, selection: String?, selectionArgs: Array<out String>?, sortOrder: String?): Cursor? {
  11.     when (uriMatcher.match(uri)) {
  12.         DIRECTORIES -> { /* TODO */ }
  13.     }
  14.     return null
  15.   }
  16.  
  17.   override fun getType(uri: Uri): String? {
  18.     return null
  19.   }
  20.  
  21.   override fun delete(uri: Uri, selection: String?, selectionArgs: Array<String>?): Int {
  22.     throw UnsupportedOperationException()
  23.   }
  24.  
  25.   override fun insert(uri: Uri, values: ContentValues?): Uri? {
  26.     throw UnsupportedOperationException()
  27.   }
  28.  
  29.   override fun update(uri: Uri, values: ContentValues?, selection: String?, selectionArgs: Array<String>?): Int {
  30.     throw UnsupportedOperationException()
  31.   }
  32.  
  33.   companion object {
  34.     private const val DIRECTORIES = 1
  35.   }
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top