I had a problem with embedding up navigation in an application with this navigation tree:

The standard implementation of the back button is fine.
Problem while trying to implement the Up button.
What I expect:
- when the user is on Details 5 Activities and press the button up, the application goes to List 3 Activities
- when the user is on Details 7 Activities and press the button up, the application will return to Home>
So, in different expressions, I would like to have this behavior in the back stack:

Documentation for Android ( Embedding Ancestral Navigation ) to use the following code to handle upward navigation :
Intent parentActivityIntent = new Intent(this, MyParentActivity.class); parentActivityIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(parentActivityIntent); finish();
But since the parent activity of the Detailed action is different from the different navigation path, I donβt know what it really is. Therefore, I cannot call it intent.
Is there a way to find out the real parental activity on the Android stack back?
If not, is there a way to implement the correct up navigation in this application?
android android-actionbar
ol_v_er Feb 01 '13 at 20:22 2013-02-01 20:22
source share