```java
Amplify.DataStore.save(post, Post.TITLE.beginsWith("[Amplify]"),
update -> Log.i("MyAmplifyApp", "Post updated successfully!"),
failure -> Log.e("MyAmplifyApp", "Could not update post, maybe the title has been changed?", failure)
);
```
```kotlin
Amplify.DataStore.save(post, Post.TITLE.beginsWith("[Amplify]"),
{ Log.i("MyAmplifyApp", "Post updated successfully!") },
{ Log.e("MyAmplifyApp", "Could not update post, maybe the title has been changed?", it) }
)
```
```kotlin
try {
Amplify.DataStore.save(post, Post.TITLE.beginsWith("[Amplify]"))
Log.i("MyAmplifyApp", "Post updated successfully!")
} catch (error: DataStoreException) {
Log.e("MyAmplifyApp", "Could not update post, maybe the title has been changed?", error)
}
```
```java
RxAmplify.DataStore.save(post, Post.TITLE.beginsWith("[Amplify]"))
.subscribe(
update -> Log.i("MyAmplifyApp", "Post updated successfully!"),
failure -> Log.e("MyAmplifyApp", "Could not update post, maybe the title has been changed?", failure)
);
```