RejectedExecutionException from AsyncTask, but haven't hit limits

前端 未结 2 1566
太阳男子
太阳男子 2020-12-29 06:29

My Android app has to deal with arriving messages which frequently come in bunches (especially during periods of flaky connectivity). I handle these incoming messages in Asy

2条回答
  •  攒了一身酷
    2020-12-29 07:24

    This exception also occur if your Executor call shutdown method and after that you give new Task (Runnable) for execution. Like

    mThreadPoolExecutor.shutdown();
    ...
    ...
    ...
    mThreadPoolExecutor.execute(new Runnable(){...});
    

提交回复
热议问题