2

Since I need the AsyncTask.executeOnExecutor() function targeting the SDK level 7 I've took the last ASyncTask code and created a mAsyncTask class.

I'd like to use mAsyncTask if the API level is < 11 and the Android's default AsyncTask (in order to seize the future SDK updates.

Since the definition of an AsyncTask extension can take a lot of lines. It is ugly and hard maintainable to copy/paste and make one extend of each class (mAsyncTask and AsyncTask) and then in run-time execute one or the other.

Is there a trick I could use for avoiding this problem?

Thanks

Addev
  • 31,819
  • 51
  • 183
  • 302
  • 1
    check: [AsyncTask.executeOnExecutor() before API Level 11](http://stackoverflow.com/questions/7211684/asynctask-executeonexecutor-before-api-level-11) – Paresh Mayani Aug 29 '12 at 09:16

1 Answers1

1

Since you can't subclass the "real" AsyncTask using relfexion, the only way is to create separate APKs.

Philippe Girolami
  • 1,876
  • 1
  • 13
  • 15