Running multiple AsyncTasks at the same time — not possible?

前端 未结 7 812
别那么骄傲
别那么骄傲 2020-11-21 13:33

I\'m trying to run two AsyncTasks at the same time. (Platform is Android 1.5, HTC Hero.) However, only the first gets executed. Here\'s a simple snippet to describe my probl

7条回答
  •  清酒与你
    2020-11-21 13:57

    if you want to execute tasks parallel,you need call the method executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, "your task name") after Android version of 3.0; but this method is not exist before Android 3.0 and after 1.6 because it execute parallel by itself, So I suggest you customize your own AsyncTask class in your project,to avoid throw exception in different Android version.

提交回复
热议问题