Skip to content

Commit

Permalink
catcg exception for launchReviewFlow
Browse files Browse the repository at this point in the history
  • Loading branch information
AlinaStepanova committed Jun 25, 2024
1 parent fdcbac0 commit 305ec9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions app/src/main/java/com/avs/sea/battle/main/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,13 @@ class MainActivity : AppCompatActivity(), PopupMenu.OnMenuItemClickListener {
val manager = ReviewManagerFactory.create(context)
val request = manager.requestReviewFlow()
request.addOnCompleteListener {
val flow = manager.launchReviewFlow(this, it.result)
flow.addOnCompleteListener {
Log.d("Review", "Review flow completed")
try {
val flow = manager.launchReviewFlow(this, it.result)
flow.addOnCompleteListener {
Log.d("Review", "Review flow completed")
}
} catch (e: Exception) {
Log.e("Review", "Error: ${e.message}")
}
}
}
Expand Down

0 comments on commit 305ec9e

Please sign in to comment.