【移动开发】startForeground()让服务保持前台级别

最近在使用android 4.1系统的时候,发如今手机休眠一段时间后(1-2小时),后台运行的服务被强行kill掉,有多是系统回收内存的一种机制,要想避免这种状况能够经过startForeground让服务前台运行,当stopservice()的时候经过stopForeground()去掉。html Running a Service in the Foreground A foreground
相关文章
相关标签/搜索