也就是说如果Activity A启动了服务S,现在需要在Activity B中终止服务S,请问应该怎么做?非常感谢各位的解答

解决方案 »

  1.   

    Intent intent = new Intent(JobStatusUpdate.this,
    GPSBackservice.class);
    stopService(intent);
      

  2.   

    无论在那个Activity里都可以停止当前的服务 Intent intent = new Intent(当前Activity.this,
    GPSBackservice.class);
    stopService(intent);
      

  3.   

    无论在那个Activity里都可以停止当前的服务 Intent intent = new Intent(当前Activity.this,
    GPSBackservice.class);
    stopService(intent);
      

  4.   

    1、获取服务:Intent
    2、停止:stopService(intent);
      

  5.   


    service 也是可以设置action的
    intent.setaction(String..);
    stopService(intent);
    正解