I want my layout to animate and rotate 90 degrees (left/right) rather than creating a new xml layout for its landscape mode.
Asked
Active
Viewed 60 times
0
-
possible duplicate of [Animation when changing orientation](http://stackoverflow.com/questions/19789190/animation-when-changing-orientation) – Ajoy Apr 28 '15 at 01:55
1 Answers
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
}

Kasun Dissanayake
- 506
- 3
- 19