androidwear-osandroid-wear-notification

How do I add a confirmation dialog to an android wear action?


I currently have an Android Wear action that is very destructive. How could I add a confirmation dialog to that action before executing it.

For example, I have an action "Finish Workout" on the wear...once a user finishes their workout, they can't resume it. I want to ask them 'Are you sure you want to finish your workout?'

how could i do this?


Solution

  • You can use DelayedConfirmationView that is designed to address this, see this tutorial. It will give your users a chance to stop/cancel the operation if they decide to.