0

My Activities are A, B, C. I have A start B, B start C. I need C to return to A using Back Navigation.

John Masiello
  • 149
  • 1
  • 4

1 Answers1

0

You can set tag android:parentActivityName in your AndroidManifest.xml to achieve this.

Find Activity C's <activity> segment in AndroidManifest.xml and put this in there:

android:parentActivityName=".package.app.ActivityA"

Example:

<activity
        android:name=".package.app.ActivityC"
        android:label="@string/title_activity_c"
        android:parentActivityName=".package.app.ActivityA" />
nbokmans
  • 5,492
  • 4
  • 35
  • 59
  • This supports up navigation. Whereas I am trying to get back to Activity A using the built-in back button. The link was helpful. I need to clear the back stack. My code goes in public void onBackPressed(). – John Masiello Sep 23 '15 at 11:13