I have a base class for my all of activities (ActivityBase
) that itself derives from android.app.Activity
. In onCreate I want to execute some conditio
You can also use the .getClass() method of the parent and then check like this
if(parent.getClass().equals(childObj.class)){
//to do ..
}
This basically works because it returns the runtime object class. This will especially work in case of abstract classes - Tried and tested recently by me in my project.