简体   繁体   English

前台服务安卓服饰

[英]Foreground service android wear

I didn't find any documentation about that. 我没有找到任何关于这方面的文件。 Is it possible to create a foreground service on android wear? 是否可以在Android服装上创建前台服务? Usually the foreground state is related with an ongoing notification but it's not possible on wear so I'm a bit confused. 通常情况下,前景状态与正在进行的通知相关,但是在佩戴时不可能,所以我有点困惑。 Is there anyone has a foreground service on wear? 有没有人穿着前台服务?

As per documentation: 根据文件:

"The system enforces a timeout period. If you are displaying an activity and user's don't interact with it, the device sleeps. When it wakes back up, the Wear home screen is displayed instead of your activity. If you need to show something persistent, create a notification in the context stream instead." “系统会强制执行超时期限。如果您正在显示活动且用户不与其进行交互,则设备会休眠。当它重新唤醒时,将显示Wear主屏幕而不是您的活动。如果您需要显示某些内容持久化,改为在上下文流中创建通知。“

So, i believe it's possible to have a persistent UI (may be not an ongoing foreground notification but a card or a stack instead). 因此,我相信可以拥有持久性UI(可能不是正在进行的前台通知,而是卡或堆栈)。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM