Code example for RotateAnimation

Methods: cancel, setDuration, setFillAfter

0
			mImageView5.setImageDrawable(getResources().getDrawable(bgs[second / 10])); 
			mImageView6.setImageDrawable(getResources().getDrawable(bgs[second % 10])); 
			Degree = (float) ((float)(1-(float)((float)(hour*3600+minute*60+second)/(count)))*(258*((float)1+((float)1/count))));			 
	    	if ( Degree < 258 ) 
	    	{ 
			RotateAnimation ra = new RotateAnimation(currentDegree,Degree,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f) ; 
	    	ra.setDuration(1);       
           clock.setAnimation(ra);                    
	    	 ra.cancel(); 
	    	 ra.setFillAfter(true); 
	    	 currentDegree = Degree; 
	    	} 
	    	else if ( repeat!= 1 ) 
	    	{ 
	    		repeat=1; 
	    		RotateAnimation ra = new RotateAnimation(currentDegree,258,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f) ; 
		    	ra.setDuration(1);       
	            clock.setAnimation(ra);                    
		    	 ra.cancel(); 
		    	 ra.setFillAfter(true); 
		    	 currentDegree = Degree;