I'm trying to make kiosk mode in smart watch. I'm having now two big problems in an attempt to implement Device Administration :
[According to https://source.android.com/devices/tech/admin/implement.html]
In addition , I will be happy, if you have a better idea to make kiosk mode in smart watch .
I keep the screen on with:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Then I disabled the left swipe by creating a new style.
AndroidManifest.xml
<application android:theme="@style/AppTheme">
res/values/styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault">
<item name="android:windowSwipeToDismiss">false</item>
</style>
</resources>
Now the only way to close the app is through the button. Maybe there is a way to override this but worst case there is always super-glue.