I'd like to gradually rotate one of my buttons in my Android application with the following code:
  for(int i=0; i<90; i++)
  {
        myButton.setRotation(i);
        try 
        {
            Thread.sleep(5);
        } 
        catch (Exception e) 
        {
            e.printStackTrace();
        }
  }
The sleep is only there to have a bit of a delay between the phases.
Once I run the code the button rotates by 90 degrees, but without gradually rotating, it simply jumps to 90 rotation.
How should I modify my code to show the in-between states as well?
 
     
     
    