Second AsyncTask not executing

后端 未结 5 487
暗喜
暗喜 2021-01-04 22:34

I have 2 AsyncTask, one which is creating a socket connections and anotherone that is transmitting objects using those sockets. my code is this:

try {
               


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-04 23:08

    Like Robin Chander said, it's likely running serially and you can use executeOnExecutor...but it isn't available until Android 3.0. If you want full compatibility, you need to dump AsyncTask and use Runnable. If you need to report results on the UI thread, don't forget to use a Handler.

提交回复
热议问题