Android Wear Prevent Sleep

↘锁芯ラ 提交于 2019-12-10 13:43:22

问题


I'm writing a small wear app that is required to be quick access for around 10 - 15 minutes at a time. Problem is when the watch sleeps (screen completely blacks out) you have to go back into the start app screen to get back to it.

The data is retained so this is more of an annoying than anything else. Is there anyway to have the watch only dim the screen but not turn it "off" until the user dismisses the app?


回答1:


Please take a look at a session from Google I/O 2014:
https://www.youtube.com/watch?v=sha_w3_5c2c#t=1241 <- 20:42

Justin talks there about android:keepScreenOn="true" attribute to prevent the timeout and "back to homescreen" behavior.

Please read more info about keeping screen on here: https://developer.android.com/training/scheduling/wakelock.html#screen



来源:https://stackoverflow.com/questions/25035523/android-wear-prevent-sleep

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!