How to get the previous Activty in android : we are in activity A and we do this following code : 

if (previousActivity.equals("Activity 1 ") ) {
calling acvtivity B }

else if (previousActivity.equals("Activity 2 ") ) {
calling activity C }


Is it possible ?

thanks in advance