I'm looking for a way to get the activity (A) which started my current activity (B).
So A calls:
Intent intent = new Intent(this, B.class);
startActivity(intent);
I'm looking for some method I can call in B to get A, so something like (in B):
Activity a = someMethodToGetCallingActivity();
Any ideas?
CLOSING EDIT:
As all the comments below say, I'm trying to use Android incorrectly. I was looking to get the instance of the activity A, but since there's no guarantee it exists, I can't. It's not a duplicate of the other question suggested because they were trying to work out which Activity (out of many) fired off the current Activity, not trying to get the instance of a particular Activity. Thanks all :)