在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));