Alex Rivera | Logout

How to find last activity from which current activity is opened in android?

Asked 2011-03-29T04:34:16.297
43

I have one activity which can be open from more 4 or 5 different activity so i can find from which activity my current activity is called...

If any idea please help me..

Edit
Report

1 Answer

2

Put some extras to intent for the different- different activities

eg:

startActivity(new Intent(this, otherActivity.class).putExtra("from" , "previousActivity"));

and get extras in the current activity as

string act = getIntent().getStringExtra("from");

so "act" will indicate you the calling Activity.

answered 2013-02-20T10:25:36.397

Your Answer