在Service中在使用StopSelf时,您是否遇到过,不能终止掉自己的情况?
遇到这种情况不要惊慌,可以通过下面的方法解决:
在需要结束掉本Service时,发给消息给Acvitivy,在Acvity中结束掉Service:
如:mContext.stopService(new Intent().setClass(mContext, MgrService.class));
在Service中在使用StopSelf时,您是否遇到过,不能终止掉自己的情况?
遇到这种情况不要惊慌,可以通过下面的方法解决:
在需要结束掉本Service时,发给消息给Acvitivy,在Acvity中结束掉Service:
如:mContext.stopService(new Intent().setClass(mContext, MgrService.class));