Perhaps the documentation needs to be updated?

As of right now, it says:

"Note: this function schedules the task on a queue for a single background
thread or pool of threads *depending on the platform version*. "

... and makes no mention of the target sdk setting in the manifest.

Still, an app with targetSdkVersion 14 or 15 running on a 3.* device will
still be getting a pool of threads.

-- K

21 апреля 2012 г. 1:39 пользователь Dianne Hackborn
<[email protected]>написал:

> Sorry yes it is API 13, I turned around the logic of the code when I
> glanced at it:
>
>         // If the app is Honeycomb MR1 or earlier, switch its AsyncTask
>         // implementation to use the pool executor.  Normally, we use the
>         // serialized executor as the default. This has to happen in the
>         // main thread so the main looper is set right.
>         if (data.appInfo.targetSdkVersion <=
> android.os.Build.VERSION_CODES.HONEYCOMB_MR1) {
>             AsyncTask.setDefaultExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
>         }
>
>
>
> On Fri, Apr 20, 2012 at 2:31 PM, Mark Murphy <[email protected]>wrote:
>
>> On Fri, Apr 20, 2012 at 5:24 PM, Dianne Hackborn <[email protected]>
>> wrote:
>> > Yes if your targetSdkVersion is >= 12, then as of that release the
>> default
>> > executor is serial.
>>
>> Bingo! It's the targetSdkVersion that's controlling the behavior.
>> Looking at the AsyncTask source code, I can't quite see how that's
>> happening, but at least I can confirm the results.
>>
>> Though for me, the serialized behavior does not kick in until a
>> targetSdkVersion of 13 -- 12 still gives me parallel operation.
>>
>> Thanks for the clarification!
>>
>> --
>> Mark Murphy (a Commons Guy)
>> http://commonsware.com | http://github.com/commonsguy
>> http://commonsware.com/blog | http://twitter.com/commonsguy
>>
>> _The Busy Coder's Guide to Android Development_ Version 3.7 Available!
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to