android - How to set onclick listener for animated image view -
i developing application has animated image view moving right center.when click on image onclick() called. when click on screen in image moving path(near image view) onclick() fired. please tell me how set on click listener image view. code is: ll = new linearlayout(this); ll.setlayoutparams(new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content)); ll.setorientation(linearlayout.vertical); ll.setgravity(gravity.center); imageview=new imageview(getapplicationcontext()); imageview.setimageresource(r.drawable.moveimage1); int width=getwindowmanager().getdefaultdisplay().getwidth()/2; system.out.println("width==="+width); movelefttoright = new translateanimation(width, 0, 0, 0); movelefttoright.setduration(3000); movelefttoright.setrepeatcount(translateanimation.infinite); // animation repeat count movelefttoright.setrepeatmode(2); ...