0

I want my layout to animate and rotate 90 degrees (left/right) rather than creating a new xml layout for its landscape mode.

Mike Laren
  • 8,028
  • 17
  • 51
  • 70
  • possible duplicate of [Animation when changing orientation](http://stackoverflow.com/questions/19789190/animation-when-changing-orientation) – Ajoy Apr 28 '15 at 01:55

1 Answers1

0

try with adding this code to your onCreate() method. I could not able to try but this should work because it calls oncreate method also when changing the orientation.

if(getResources().getConfiguration().orientation==Configuration.ORIENTATION_PORTRAIT){
        //insert your code here when it is portrait
    }
    else if(getResources().getConfiguration().orientation==Configuration.ORIENTATION_LANDSCAPE){
        //insert your code here when it is landscape
    }