android - onPostExecute on cancelled AsyncTask -


does onpostexecute execute if asynctask has been cancelled?

if execute, safe should ask if task has been cancelled (iscancelled) @ start of onpostexecute, before doing else?

the documented behaviour of onpostexecute on cancel() changed between android 2 , android 4.

android 2.3.7 onpostexecute :

runs on ui thread after doinbackground. specified result value returned doinbackground or null if task cancelled or exception occured.

android 4.0.1 onpostexecute :

runs on ui thread after doinbackground. specified result value returned doinbackground. method won't invoked if task cancelled.

so if still targeting android 2 devices should assume onpostexecute called , in onpostexecute check null result.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -