我有一项 Activity 将多个上传进程放入 IntentService 的队列中。现在我想显示一个待处理和已开始上传的列表,以及一个停止上传的按钮。
基于这个问题Asking an IntentService for information about its queue我开始实现外部队列,但到目前为止我还不知道如何停止特定任务。
有没有更好的方法来管理 IntentService 的队列?
最佳答案
在您的 IntentService 中注册 BroadCastReceiver("stopUpload") 以在收到此 Intent 时停止上传。从您的 Activity 的 sendBroadcast("stopUpload") 触发该 Intent 。
关于android - 如何访问 IntentService 的队列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7873831/