Thread doc中描述的android doc。 cancelAll()抛出异常

时间:2015-05-10 19:19:45

标签: android multithreading threadpoolexecutor

我已经下载了示例ThreadSample https://developer.android.com/training/multiple-threads/run-code.html 并添加一个调用PhotoManager.cancellAll()的按钮,该按钮会抛出异常

 java.lang.ArrayStoreException: com.example.android.threadsample.PhotoDownloadRunnable cannot be stored in an array of type com.example.android.threadsample.PhotoTask[]

我想知道如何修复它以及如何取消ThreadPoolExecutor的所有线程,这个方法试图这样做。

0 个答案:

没有答案