【问题标题】:Life cycle of an IntentService if it also have a BackgroundThreadIntentService 的生命周期(如果它也有 BackgroundThread)
【发布时间】:2015-01-23 05:18:01
【问题描述】:

我有一个任务,它应该按顺序进行。后处理它应该并行执行几个任务。 我在 IntentService 中使用 BackgroundThread。 这是一个好方法还是我应该采取任何其他方法?

【问题讨论】:

    标签: android intentservice background-thread


    【解决方案1】:

    听起来对我来说是正确的解决方案。如果您为每个 Intent 启动一个后台线程,您将获得所需的并行行为。如果你做了很多这些,你可能想要使用 ThreadPool,因为创建线程非常昂贵。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-10
      • 1970-01-01
      相关资源
      最近更新 更多