安卓:服务自动重启 [英] Android : Service restarting automatically

查看:182
本文介绍了安卓:服务自动重启的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与这节省了服务的 GPS经纬度的 continiously

I'm working with a service which saves GPS latlng's continiously

但是很多时候该服务是越来越自动重新启动,这导致数据的丢失...

But many times the service is getting restarted automatically, which results in data loss...

那么,有没有办法,我们可以重新启动限制的服务。或任何想法来清除这个问题。

so is there any way that we can restrict the service from restarting. or any idea to clear this issue.

推荐答案

您可以通过提到它在清单文件

You can create a new process for the service by mentioning it in the Manifest file as

android:process=":newservice"

里面的服务标签

Inside the service tag

这篇关于安卓:服务自动重启的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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