Android 终止活动进程时服务重新启动
我有一个活动,它通过我的服务的Android 终止活动进程时服务重新启动,android,android-service,Android,Android Service,我有一个活动,它通过我的服务的android:process属性在单独的流程中启动服务 我的服务的onStartCommand()函数返回START\u 我通过“最近使用的应用程序”按钮将活动进程刷走,从而终止活动进程,然后服务进程重新启动 我想知道在活动进程终止时,是否有办法保持服务运行 I want to know if there is a way to keep the service running when the activity process is killed. 不,无法保
android:process
属性在单独的流程中启动服务
我的服务的onStartCommand()
函数返回START\u
我通过“最近使用的应用程序”按钮将活动进程刷走,从而终止活动进程,然后服务进程重新启动
我想知道在活动进程终止时,是否有办法保持服务运行
I want to know if there is a way to keep the service running when the activity process is killed.
不,无法保持服务运行。因为
Closed by the user via the Running Services screen in Settings.
Closed by the user via a task killer.
Closed by Android to free up memory in times of need.
但你可以做到
-->您可以使用广播接收器重新启动服务(当来电、启动完成、收到短信等时,根据您的要求使用此功能)您找到解决方案了吗?@Perry\u ml没有。我放弃了这个项目。