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

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

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

unit testing - How to mock PreferenceManager in Android? -