* AsyncTask


> boolean cancel(boolean mayInterruptIfRunning)

- mayInterruptIfRunning 는 실행중인 작업을 취소할지의 여부를 결정

: false 의 경우, doInBackground() 가 수행 완료 된 후에, onCancelled() 가 호출

: true 의 경우, 바로 종료하기 위한 Exception 을 던지기 때문에, doInBackground()에서 InterruptedException 발생

- cancel() 을 호출하더라도 작업을 일찍 끝내기는 어렵다. 좀 더 빠르게 작업을 종료하기 위해서는 doInBackground() 에서 isCancelled() 를 통해

종료하면, onPostExecute() 대신 onCancelled() 가 호출된다

'SW > Android' 카테고리의 다른 글

Cursor  (0) 2021.04.02
Dalvik VM  (0) 2020.08.15
Zygote  (0) 2020.08.15
ANR (Application Not Responding)  (0) 2020.08.15
//View  (0) 2020.06.20

+ Recent posts