Friday, 9 August 2013

ActionBar Up Button not going where expected on Android 4.1.2

ActionBar Up Button not going where expected on Android 4.1.2

I have 4 Activities, like so :
MainActivity -> Activity B -> Activity C
\ Activity A /
The Activity on the left is the right Activity's parent.
I'm using SherlockActionBar to provide the up navigation.
The "default" path is MainActivity -> Activity B > Activity C and it works
perfectly on every phone, I can go up C > B > Main.
On Android 2.3, When I'm going Main > A > C, the up navigation goes C > B
> Main, which is expected.
On Android 4.1.2 (Galaxy S3), with the same path Main > A > C, the up
navigation does C > Main, it totally misses the Activity B, the logical
parent.
Here is a some of my AndroidManifest.xml (I removed the package name)
<activity
android:name="my.package.ActivityA"
android:label="@string/title_activity_a"
android:parentActivityName="my.package.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="my.package.MainActivity" />
</activity>
<activity
android:name="my.package.ActivityB"
android:label="@string/title_activity_b"
android:parentActivityName="my.package.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="my.package.MainActivity" />
</activity>
<activity
android:name="my.package.ActivityC"
android:label="@string/title_activity_c"
android:parentActivityName="my.package.ActivityB" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="my.package.ActivityB" />
</activity>
I don't know if I made myself clear enough, Here is someone having the
same problem : Confused by ActionBar UP navigation

No comments:

Post a Comment