I have activity AActivity which calls Activity BActivity.
In the AndroidManifest
I specify B as follows:
<activity android:name=".main.BActivity"
android:parentActivityName=".main.AActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".main.AActivity" />
</activity>
If I'm in Activity B
and click on the phone's Back-Button, then I go back to Activity A
without calling A.onCreate();
again - that's how I want it to be. But If I'm in Activity B
and click the ActionBar's Back button
on the top left, then I go back to Activity A
again, but A.onCreate();
is called. How can I use the backbutton of the top of the Activity to behave in the manner the phone's back button does, i.e. not calling StartingActivity.onCreate() ?
Btw: Activity A and B are extending from AppCompatActivity
.