Avoid usage of AsyncTask Class on android

less than 1 minute read

Just noticed this method available from API 11 only,  so you should find another implementation to avoid unexpected behaviour.

Or don't call the execute method,  why?  If you'll check documentation you'll see that in some versions of android all tasks will run synchronouslly on the same background thread and on some versions it'll run on a pool of threads. Always use the executeOnExecutor option for consistent behaviour between platform version and avoid unexpected behaviour.

See docs

Comments