Very true, Nathan.

When calling cancel(true), an interrupt is 'called' on the thread. This 
means that methods that put the thread into a wait-state (wait, sleep and 
such) get interrupted and these will throw an interrupted-exception. Some 
(not all!) blocking IO operation may get interrupted as well, but they are 
not guaranteed to throw an interrupted-exception, as you found out in your 
case. Instead, a io-exception was thrown.

In short, 
when calling cancel(false), you'd only have to deal with the isCancelled 
method. But blocking operations won't get interrupted.
when calling cancel(true), you'd have to deal with the isCancelled method 
and blocking operation will get interrupted somehow. The downside to these 
interrupted operations is that you need to deal with them properly (catching 
the appropriate exceptions and dealing with them).

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to