I have many types of activity's, but if at a certain point activity is a TaskComplianceActivity then I want to handle it in a special way.
I could do:
if (activity.getClass().getName() == "au.net.example.myapp.TaskComplianceActivity")
But that is very ugly.
I have tried this, but it didn't work:
if (activity instanceof TaskComplianceActivity)
Does anyone have any suggestions on how I can cleanly do this?
instanecofwould also include anullcheck