Example usage for android.widget Chronometer setBase

List of usage examples for android.widget Chronometer setBase

Introduction

In this page you can find the example usage for android.widget Chronometer setBase.

Prototype

@android.view.RemotableViewMethod
public void setBase(long base) 

Source Link

Document

Set the time that the count-up timer is in reference to.

Usage

From source file:hku.fyp14017.blencode.ui.controller.SoundController.java

private void continuePlayingSound(Chronometer chronometer, long base) {
    chronometer.setBase(base);
    chronometer.start();
}

From source file:org.linphone.InCallActivity.java

private void registerCallDurationTimer(View v, LinphoneCall call) {
    int callDuration = call.getDuration();
    if (callDuration == 0 && call.getState() != State.StreamsRunning) {
        return;//from  www.  j a v  a2  s  .  c o m
    }

    Chronometer timer = (Chronometer) v.findViewById(R.id.callTimer);
    if (timer == null) {
        throw new IllegalArgumentException("no callee_duration view found");
    }

    timer.setBase(SystemClock.elapsedRealtime() - 1000 * callDuration);
    timer.start();
}

From source file:co.taqat.call.CallActivity.java

private void registerCallDurationTimer(View v, LinphoneCall call) {
    int callDuration = call.getDuration();
    if (callDuration == 0 && call.getState() != State.StreamsRunning) {
        return;/*w  w w  .j  a v a2s  .  c om*/
    }

    Chronometer timer;
    if (v == null) {
        timer = (Chronometer) findViewById(R.id.current_call_timer);
    } else {
        timer = (Chronometer) v.findViewById(R.id.call_timer);
    }

    if (timer == null) {
        throw new IllegalArgumentException("no callee_duration view found");
    }

    timer.setBase(SystemClock.elapsedRealtime() - 1000 * callDuration);
    timer.start();
}