Here we used another method startAnimation() to apply the defined animation to imageview object. The second parameter in loadAnimation() method is the name of our animation xml file. If you observe above code snippet, we are adding an animation to the image using loadAnimation() method. imgvw ) Īnimation aniRotate = AnimationUtils.loadAnimation(getApplicationContext(),R.anim. ImageView img = (ImageView)findViewById(R.id. To Rotate animation in Clockwise, we need to set android :fromDegrees and android :toDegrees property values and these will defines a rotation angles like as shown below. To use Rotate animation in our android applications, we need to define a new xml file with tag like as shown below. In case, if anim folder does not exist in res directory, create a new one. We need to create an XML file that defines the type of animation to perform in a new folder anim under res directory ( res à anim à rotate.xml) with required properties. To create an animation effect on the objects in our android application, we need to follow the below steps. Generally, the animations are useful when we want to notify users about the changes happening in our app, such as new content loaded or new actions available, etc. The Rotate animation will provide a better look and feel for our applications. In android, Rotate animation is used to change the appearance and behavior of the objects over a particular interval of time.