I would like to compare the calling activity to others to know which one called the current activity. I tried:
getCallingActivity().getClassName().toString().equals(MainActivity.class.toString())
It doesn't work, except by passing a value in the calling Intent, how can we compare classes using getCallingActivity()
or getCallingPackage()
?