Transitions between Activities

CodeMonkeyCodeMonkey Adrian EstranGBMember ✭✭✭
edited October 2012 in Android

I'm playing with the MWC.Droid sample app and looking through the code as I go. I'v noticed that transitions between some of the Activities are animated much like they are in IOS, but I can't see the code that is making this happen?

In my application when I call StartActivity I get no animation with the transition, just a straight forward switch between the two screens. In the MWC app, if you go to the SpeakersScreen and then select a speaker which takes you to the SpeakersDetailScreen you get a nice transition, SpeakerScreen is calling this code:

  speakerListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
  {
        var speakerDetails = new Intent(this, typeof(SpeakerDetailsScreen));
        speakerDetails.PutExtra("SpeakerID", speakers[e.Position].ID);
        StartActivity(speakerDetails);
  };

So where is this transition coming from?

Adrian

Posts

  • CodeMonkeyCodeMonkey Adrian Estran GBMember ✭✭✭

    Sorry, just realized this must be device specific, HTC One X doesn't like animated transitions..

  • JoeJoe Joseph Phillips AUMember

    I think it's on by default. You can disable it in code like this:

    speakerDetails.AddFlags(ActivityFlags.NoAnimation);

Sign In or Register to comment.