How to run multiple background tasks in parallel using AsyncTask in android..? -
i beginner in android development. ve tried using simple execute() 1 task , worked well. have come across problem need perform 3-4 tasks concurrently in background using asynctask. have seen several questions on dint see code doing same. think executeonexecutor() answer question want see example of it. can please explain me simple example of how run 2 tasks concurrently using asynctask ?
the docs asynctask cover this. default, of asynctasks happen on single thread. use multiple threads, need use different executor. asynctask has thread pool executor can use:
task.executeonexecutor(asynctask.thread_pool_executor, params);
Comments
Post a Comment