I'm working on a project that was originally designed for Honeycomb; we want to make it compatible with 2.3.3. I'm doing this by converting a copy of the original project to a library project, including this library into several new projects, and subclassing some elements in the new projects to use specific APIs.
However we have lots of AsyncTask<...>
subclasses; AsyncTask<...>
exists in 2.3.3 but the onCancelled()
method, which we implement, only exists since Honeycomb. I'm concerned that if I leave these classes in the central library project, the onCancelled()
method will not be hit because (effectively) it has been built against the 2.3.3 Android library, which doesn't have it. However, I don't want to reproduce these classes in every sub-project without a good reason and I can't see how subclassing would make anything better: the superclass would STILL be against the 2.3.3 version of AsyncTask<...>
. My question is: does Java/Android allow for this, and will onCancelled()
be hit in higher versions of Android?