Loading src/main/java/at/bitfire/ical4android/JtxCollection.kt +3 −2 Original line number Diff line number Diff line Loading @@ -132,11 +132,12 @@ open class JtxCollection<out T: JtxICalObject>(val account: Account, } /** * @param [UID] of the entry that should be retrieved as content values * @param [uid] of the entry that should be retrieved as content values * @return Content Values of the found item with the given UID or null if the result was empty or more than 1 * The query checks for the [uid] within all collections of this account, not only the current collection. */ fun queryByUID(uid: String): ContentValues? { client.query(JtxContract.JtxICalObject.CONTENT_URI.asSyncAdapter(account), null, "${JtxContract.JtxICalObject.ICALOBJECT_COLLECTIONID} = ? AND ${JtxContract.JtxICalObject.UID} = ?", arrayOf(id.toString(), uid), null).use { cursor -> client.query(JtxContract.JtxICalObject.CONTENT_URI.asSyncAdapter(account), null, "${JtxContract.JtxICalObject.UID} = ?", arrayOf(uid), null).use { cursor -> Ical4Android.log.fine("queryByUID: found ${cursor?.count} records in ${account.name}") if (cursor?.count != 1) return null Loading Loading
src/main/java/at/bitfire/ical4android/JtxCollection.kt +3 −2 Original line number Diff line number Diff line Loading @@ -132,11 +132,12 @@ open class JtxCollection<out T: JtxICalObject>(val account: Account, } /** * @param [UID] of the entry that should be retrieved as content values * @param [uid] of the entry that should be retrieved as content values * @return Content Values of the found item with the given UID or null if the result was empty or more than 1 * The query checks for the [uid] within all collections of this account, not only the current collection. */ fun queryByUID(uid: String): ContentValues? { client.query(JtxContract.JtxICalObject.CONTENT_URI.asSyncAdapter(account), null, "${JtxContract.JtxICalObject.ICALOBJECT_COLLECTIONID} = ? AND ${JtxContract.JtxICalObject.UID} = ?", arrayOf(id.toString(), uid), null).use { cursor -> client.query(JtxContract.JtxICalObject.CONTENT_URI.asSyncAdapter(account), null, "${JtxContract.JtxICalObject.UID} = ?", arrayOf(uid), null).use { cursor -> Ical4Android.log.fine("queryByUID: found ${cursor?.count} records in ${account.name}") if (cursor?.count != 1) return null Loading