Reputation: 75
I need to know how we can close the application on swipe left in Android Wear 2.0. It's a standalone application.
this.finishAffinity();
Thanks in advance
Upvotes: 0
Views: 969
Reputation: 4784
For and Activity
you don't have to do anything, as stated in the documentation
An activity automatically supports swipe-to-dismiss. Swiping an activity from left to right results in dismissal of the activity, and the app navigates down the back stack.
If you use a Fragment
you need to wrap it in a SwipeDismissFrameLayout. For more details about how to do that, or how to handle other edge cases, have a look at the documentation referenced above.
Upvotes: 1