I use ActivityGroup to manage activities, I want to add animation when change activity, the code I used to change to next activity is:
Intent intent = new Intent(getParent(), AnotherActivity.class);
TabGroupActivity parentActivity = (TabGroupActivity) getParent();
parentActivity.startChildActivity("AnotherActivity", intent);
And inside startChildActivity
:
Window window =getLocalActivityManager().startActivity(Id,intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
if (window != null) {
View view = window.getDecorView();
mIdList.add(Id);
setContentView(view);
}
TabGroupActivity
is just an ActivityGroup
, provides some useful methods. With the above code, what/where do I add to enable animation?
I needed to implement wizard with page transitions sometime ago. And I used ActivityGroup approach. It had
Wizard
(inherited fromAcitivtyGroup
) andWizardPage
(inherited fromActivity
).WizardPage
had code that handled animations, whileWizard
was responsible to call those animations in appropriate times.WizardPage
class:Wizard
hadstartPage
method which was called to make the actual activity transitions: