Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android No Animation When Transitioning From a Portrait Activity to a Landscape Activity

I have Activity A which is set to run in portrait orientation (android:screenOrientation="portrait" set on this activity in the manifest). This activity opens to Activity B on a button click. Activity B is set to run in landscape orientation (android:screenOrientation="landscape" set on this activity in the manifest). Regardless of what I set in my overridePendingTransition method, there is never an animation. It's always a hard cut. Is there a way to force some sort of animation when transitioning from Activity A to Activity B?

Also, I get the same issue when transitioning back from Activity B to Activity A.

Edit (from Praveen):

Even i have decalred the configChanges="orientation" in the Manifest. Still i am facing this Problem?? Any Idea on this???

Thanks in advance

like image 358
groomsy Avatar asked Jun 18 '11 15:06

groomsy


1 Answers

i think you have to override activity's onConfigurationChange method. perhaps this will help you.

for example

@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);

    updateGui();
}
like image 171
Pratik Popat Avatar answered Sep 17 '22 13:09

Pratik Popat