如何访问IntentService的队列?

发布于 2024-12-11 16:55:49 字数 296 浏览 0 评论 0原文

我有一个活动将多个上传进程放入 IntentService 的队列中。现在我想显示待上传和已开始上传的列表,以及停止上传的按钮。

基于这个问题向 IntentService 询问有关其队列的信息我开始实现一个外部队列,但到目前为止我不知道如何停止特定任务。

有没有更好的方法来管理 IntentService 的队列?

I have an activity which puts several upload processes into the queue of an IntentService. Now i would like to show a list of the pending and started uploads, and a button to stop an upload.

based on this question Asking an IntentService for information about its queue i started to implement an external queue but so far i have no idea how to stop a specific task.

Are there any better ways how to manage the queue of an IntentService?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

还不是爱你 2024-12-18 16:55:49

在 IntentService 中注册一个 BroadCastReceiver("stopUpload") 以在收到此意图时停止上传。从您的活动的 sendBroadcast("stopUpload") 触发该意图。

Register a BroadCastReceiver("stopUpload") in your IntentService to stop uploading when this intent is received. Trigger that intent from your activity's sendBroadcast("stopUpload").

会傲 2024-12-18 16:55:49

使用 Service 和 AsyncTasks 不是更好吗?

Aren't you better off with a Service and AsyncTasks ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文