Code example for TimeAnimator

Methods: setTimeListenerstart

        // On JB, we rely on TimeAnimator to send events tied with vsync. 
        return new Runnable() {
            public void run() { 
                mTimeAnimator = new TimeAnimator();
                mTimeAnimator.setTimeListener(new TimeListener() {
                    public void onTimeUpdate(TimeAnimator animation, long totalTime,
                            long deltaTime) {
                        if (!sendEvent(mDownTime + totalTime)) {
    private Runnable createPreJBRunnable() {
        // Pre-JB there's no TimeAnimator, so we keep posting messages. 
Connect your IDE to all the code out there  Get Codota for Java