I have got an array of Classes, declared as follows:
Class<?>[] serviceStack = {GetPlanningData.class, GetTimeTable.class, GetDataToSync.class, GetData.class};
Classes GetPlanningData, GetTimeTable, GetDataToSync and GetData are all subclasses of IntentService.
Can I declare an array of subclasses of IntentService? I tried:
Class<? extends IntentService>[] serviceStack;
and
Class<IntentService>[] serviceStack;
but the first one is a "Generic array creation", as Android Studio says, and the second one permits only to create {IntentService.class, IntentService.class, ...} and no subclasses are allowed.
EDIT: I am programming in Android, and the main goal of this is to call Services sequantially. So I put this array as an extra of the first Service and when the service has finished I call the first element of the array, passing the array without the first element.
This works, but I can't use Lists because I can't put a List extra to a Context.
List<? extends IntentService>.IntentServicesequentially, but I can't use a List (that'd be great) because, programming on Android, I can't put a List "extra".