Code example for View

Methods: setOnClickListener

0
        setupAnimation(setButton, setAnimation, R.animator.combo);
 
    } 
 
    private void setupAnimation(View view, final Animator animation, final int animationID) {
        view.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                // If the button is checked, load the animation from the given resource 
                // id instead of using the passed-in animation parameter. See the xml files 
                // for the details on those animations. 
                if (mCheckBox.isChecked()) {
                    Animator anim = AnimatorInflater.loadAnimator(PropertyAnimations.this, animationID);
                    anim.setTarget(v);
                    anim.start();
                    return; 
                } 
                animation.start();
            } 
        }); 
    } 
Contextual code suggestions in your IDE  Get Codota for Java