在力杀重新启动应用程序 [英] Restart app on force kill

查看:172
本文介绍了在力杀重新启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了一个地理定位服务。使用一些任务杀的应用程序,在管理应用程序当部队打死 - >运行选项卡我的应用程序是显示为0进程和1个服务和状态正在重新启动,但没有得到重新启动。

I got a geolocation service. When force killed using some Task Killing apps, in the 'Manage Application' -> Running tab my App is showing as 0 Process and 1 service, and status is Restarting, but not getting restarted.

public int onStartCommand(Intent intent, int flags, int startId) {
    return START_REDELIVER_INTENT;
}

我开始使用我的服务

I started my service using

startService(new Intent(this, MyService.class));

有什么办法来重新启动该进程?

Is there any way to restart the process?

推荐答案

使用

返回START_STICKY

代替。

这篇关于在力杀重新启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆