I have a very weird problem. It has to do with overridePendingTransition not working properly on only 1 activity transition (after back button is pressed) and only on the Galaxy Tab 10.1 running Honeycomb.
Here is the situtation. I have a BaseActivity class the extends Activity. I use this to add some transition changes away from android default.
I Override the finish() function like so:
@Override
public void finish()
{
super.finish();
Log.i(StaticValues.TAG, "Calling finish in ActivityBase");
overridePendingTransition(getAnimationId("slide_in_right") ,getAnimationId("slide_out_right"));
}
I have to use getAnimationId as I am using unity and cannot use R.anim.slide_in_right/left
also getAnimationId is the below function for any that might want to know:
protected int getAnimationId(String animName)
{
if(mResources == null)
{
mResources = this.getResources();
}
return mResources.getIdentifier(animName, "anim", mPackage);
}
Now here comes the weird part. This works great when calling any activity based on ActivityBase from the main Activity on my nexus S phone. It also works good when calling two activities (just info activities, links to webpages etc) when on my Galaxy Tab 10.1, but when calling the 3rd activity (an audio recorder) the transition in is ok (a slide) but when exiting (either via calling finish or back button) it looks like the orientation changes to landscape (standard home screen since this is a tablet) then loads the main activity back the way it was.
Since I gave you the history of this. Can someone tell me why this might be happening only on that one activity and only on the tablet.
public void finish()
{
removeUnsavedRecording();
super.finish();
}
The above is my overridden finish function in my audio recorder activity.
Ok i have fixed this error and I fixed it a weird way. My AudioRecorderActivity was a launcher class during the testing phase. For some reason the device cached the exit animation for this. (weird). So I fixed the problem by changing my ActivityBase finish() method’s overridepending to another two animations (which worked) then changed them back.
So my only option is to believe that the app somehow cached the default animation for this activity (from when it was a launcher activity). Do not see any other explanation for this.