当未经授权的人从设备设置中终止服务时,有什么方法可以重新启动我的服务?当授权用户想要停止服务时,我会提供一个需要密码的界面。
如果需要重新启动任何在运行时终止的服务,则使用以下命令
public int onStartCommand(Intent intent,int flags,int startId)
{
.........//your service coding //
........................
return Service.START_STICKY
}