start Or Resume Animator - Android android.animation

Android examples for android.animation:Animator

Description

start Or Resume Animator

Demo Code


//package com.java2s;
import android.animation.Animator;
import android.annotation.SuppressLint;
import android.os.Build;

public class Main {
    @SuppressLint("NewApi")
    public static void startOrResumeAnimator(Animator animator) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            if (animator.isPaused()) {
                animator.resume();/*  w  ww . j a  v a  2s  . c  om*/
                return;
            }
        }

        animator.start();
    }
}

Related Tutorials