I have an abstract generic class.
public abstract class FieldHandlerWithData<DataType extends Parcelable>
extends FieldHandler
Now I have an object c
Class<? extends FieldHandler> c = getHandlerClass(type);
and now I want to test if c inherits FieldHandlerWithData (directly or indirectly).
How to determine whether c inherits FieldHandlerWithData?
c.isAssignableFrom(FieldHandlerWithData.class) – returns false.
It’s the other way around –
FieldHandlerWithData.class.isAssignableFrom(c)So this class (the one on which the method is invoked) should be the superclass/superinterface