Reputation: 3
I have an Activity A, which starts activity B, which starts activity C. When I press back button I want go back to the Activity A. Instead, activity B is always opened (as a popup thanks to the style) after pressing back on activity C.
I try with meta-data following android doc but i can't solve my issue.
http://developer.android.com/training/implementing-navigation/ancestral.html
<activity
android:name="com.test.A"
android:label="@string/ActivityA"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.test.B"
android:label="@string/ActivityB"
android:theme="@android:style/Theme.Holo.Dialog" >
</activity>
<activity
android:name="com.test.C"
android:label="@string/ActivityC" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.test.A"/>
</activity>
Upvotes: 0
Views: 74
Reputation: 25267
try this way.
...
finish();
startActivity(new Intent(ActivityB.this, ActivityC.class));
...
Upvotes: 1
Reputation: 2761
After you start activity C from Activity B call finish(); It will remove B from the stack.
Upvotes: 0