How to animate button before it is clicked

0

Here's an animation I'm using in my project, but it gets animated as soon as it's clicked:

Button refresh = (Button)findViewById(R.id.refresh);
refresh.setOnClickListener(new View.OnClickListener() {

    @Override
    public void onClick(View arg0) {
        arg0.startAnimation(rotate);

        webView.loadUrl(urlOriginal);
    }
});

I would like to put the animation as soon as it appears on the screen, ie without having to be clicked on for the animation to start.

    
asked by anonymous 08.03.2016 / 12:22

0 answers