Android中线程和异步任务之间的最佳选择是什么?

Android中线程和异步任务之间的最佳选择是什么?,android,multithreading,android-asynctask,Android,Multithreading,Android Asynctask,在线程和asynctask之间使用java web服务和Android客户端的最佳方式是什么?使用asynctask: Simple network operations which do not require downloading a lot of data Disk-bound tasks that might take more than a few milliseconds 将Java线程用于: Network operations which involve moderate t

在线程和asynctask之间使用java web服务和Android客户端的最佳方式是什么?

使用asynctask:

Simple network operations which do not require downloading a lot of data
Disk-bound tasks that might take more than a few milliseconds
将Java线程用于:

Network operations which involve moderate to large amounts of data (either uploading or downloading)
High-CPU tasks which need to be run in the background
Any task where you want to control the CPU usage relative to the GUI thread
对于线程

如果将结果回发到主线程,则与主线程同步 用户界面无用于取消线程的默认值无默认线程 在Android中没有处理配置更改的默认池


这也取决于你的要求。你可以在这里找到原始的帖子