I am running a simple android app in my android wear Lg G watch. It is not an android wear app. So when I try to do it like this answer How to disable the android wear back swipe? , I get errors saying "Error: No resource found that matches the given name Theme.DeviceDefault" and "Error: No resource found that matches the given name attr: android:windowSwipeToDismiss" . My target sdk is 18. Is there a way I can disable the back swipe in this case?
Asked
Active
Viewed 982 times
1 Answers
2
You should use target sdk 21, which is on all Android Wear devices.
Follow the advice from the previous question, which is:
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light">
<item name="android:windowSwipeToDismiss">false</item>
</style>
You need the sdk 21, because windowSwipeToDismiss wasn't introduced yet in 18. I believe this attr was introduced in 20, but since all wear devices have api level 21, it doesn't make sense to use the earlier one. Enjoy using most recent APIs ;-)

gruszczy
- 40,948
- 31
- 128
- 181