Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试编写一个可以监听音量键按下的服务,但我在某处读到服务不应该对用户操作做出反应。这也适用于前台服务吗?
谢谢!
前台服务是普通服务,唯一的区别是当系统内存不足时这些服务不太可能/不会被杀死,因为用户会主动意识到它们(例如下载带有进度指示器的文件作为通知)。如果您愿意,这只是更高优先级的内存。
所以是的,这也适用于那些。