android - why wont his imageview rotate? -


i trying rotate image view @ center. when click on image, wont rotate. reason why?

        refreshresults.setonclicklistener(new view.onclicklistener() {         @override         public void onclick(view v) {              rotateanimation anim = new rotateanimation(0.0f, 360.0f, animation.relative_to_self, 0.5f, animation.relative_to_self, 0.5f);             anim.setinterpolator(new linearinterpolator());             anim.setrepeatcount(animation.infinite);             //how start it.             refreshresults.startanimation(anim);         }     }); 

try working me.

rotateanimation myanim = new rotateanimation(0, 45, animation.relative_to_self,             0.5f, animation.relative_to_self, 0.5f);  myanim .setinterpolator(new linearinterpolator()); myanim .setduration(500); myanim .setfillenabled(true); myanim .setfillafter(true);  image.startanimation(myanim ) 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -