Search code examples
c#androidxamarinanimationandroid-activity

How to handle animations when start/exit an Android.Provider.Settings activity?


I'm wondering if it's possible to handle animations for Android.Provider.Settings?

Below is the code to start the Android.Provider.Settings.ActionWifiSettings activity with animations, but after, i don't know how to set animations when the user get back to the previous activity (by pressing the back button).

Intent intent = new Intent(Android.Provider.Settings.ActionWifiSettings);
this.StartActivity(intent);
OverridePendingTransition(Resource.Animation.abc_slide_in_bottom, Resource.Animation.abc_fade_out);

I'm working on a xamarin.android.

Thank you.

Regards.


Solution

  • Add animation in OnResume method of your activity.For do this you must override OnResume method and add animation

    protected override void OnResume()
        {
            base.OnResume();
            OverridePendingTransition(Resource.Animation.abc_slide_in_bottom, 
            Resource.Animation.abc_fade_out);
    
    
        }