Reputation: 110550
My android application has 1 main activity. And it launches some sub-activity (which I wrote) and that also launches some sub-activity (which I wrote). I do this:
Intent i = new Intent("my intent1");
startActivity(i);
My question is how can each of my sub-activity and sub-sub-activity get back to the Parent activity?
Thank you.
Upvotes: 1
Views: 2328
Reputation: 110550
I think there is a method getParent() which returns the parent Activity of a child activity.
Upvotes: 1
Reputation: 26668
You should start your sub Activities via [startActivityForResult()][1], and when you're done in your sub-activity, call finish()
. This will close the sub-activity and return to the Activity that called startActivityForResult.
Upvotes: 5