Skip to content

Instantly share code, notes, and snippets.

@akbarsha03
Last active May 27, 2017 08:07
Show Gist options
  • Save akbarsha03/045efdb019409da9bb4fd5bbaed6e13f to your computer and use it in GitHub Desktop.
Save akbarsha03/045efdb019409da9bb4fd5bbaed6e13f to your computer and use it in GitHub Desktop.
val contact = ContactModel()
val isSuccess = contact.run {
var isSuccess = false
try {
ActiveAndroid.beginTransaction()
groupName = "GROUP NAME"
type "PRIVATE"
subject = "PHYSICS GROUP"
save()
isSuccess = true
ActiveAndroid.setTransactionSuccessful()
} catch (ignored: Exception) {
isSuccess = false
} finally {
ActiveAndroid.endTransaction()
}
isSuccess
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment