[android-developers] Re: AsyncTask in Android 4.0
Some of this is a little over my head, but from what I can understand, if the targetSdkVersion is set to 13 or greater and I have a "long running" AsyncTask (not exactly sure what is considered a long running task), I should use this code to execute the AsyncTask?
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
} else {
task.execute(params);
}
Does in matter if the AsyncTask is used in a service or not?
-Kris
http://www.filtrsoft.com - Custom news monitoring apps
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home