3

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.

4

1 に答える 1

0

OK、このエラーを修正し、奇妙な方法で修正しました。私の AudioRecorderActivity は、テスト段階ではランチャー クラスでした。何らかの理由で、デバイスはこのために終了アニメーションをキャッシュしました。(変)。そこで、ActivityBase の finish() メソッドの overridepending を別の 2 つのアニメーション (動作) に変更して問題を修正し、それらを元に戻しました。

したがって、私の唯一のオプションは、アプリがこのアクティビティのデフォルトのアニメーションを何らかの方法でキャッシュしたと信じることです (ランチャーアクティビティのときから)。これに関する他の説明はありません。

于 2012-12-14T15:53:17.080 に答える