android - How to set two animations to layouts and trigger it when the orientation changes? -


i want layout animate , rotate 90 degrees (left/right) rather creating new xml layout landscape mode.

try adding code oncreate() method. not able try should work because calls oncreate method when changing orientation.

if(getresources().getconfiguration().orientation==configuration.orientation_portrait){         //insert code here when portrait     }     else if(getresources().getconfiguration().orientation==configuration.orientation_landscape){         //insert code here when landscape     }