本文整理汇总了Java中android.widget.Chronometer.getBase方法的典型用法代码示例。如果您正苦于以下问题:Java Chronometer.getBase方法的具体用法?Java Chronometer.getBase怎么用?Java Chronometer.getBase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.Chronometer
的用法示例。
在下文中一共展示了Chronometer.getBase方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BaseTime
import android.widget.Chronometer; //导入方法依赖的package包/类
/**
* This returns the current base time for the time clock.
*
* @return the current base time in ms
*/
public long BaseTime() {
if (view != null) {
return view.getBase();
} else {
Chronometer c = (Chronometer) container.$context().findViewById(resourceId);
return c.getBase();
}
}
示例2: DisplayTime
import android.widget.Chronometer; //导入方法依赖的package包/类
/**
* This returns the actual text that is displayed
* in the TimeClock. This is useful for getting
* what the current time is in the TimeClock (as when
* start() is called, it only updates the display, and
* doesn't update the base time).
*
* @return String representing the displays time
*/
// This should just get removed, actually.
private String DisplayTime() {
long time;
if (view != null) {
time = SystemClock.elapsedRealtime() - view.getBase();
} else {
Chronometer c = (Chronometer) container.$context().findViewById(resourceId);
time = SystemClock.elapsedRealtime() - c.getBase();
}
return DateUtils.formatElapsedTime(mRecycle, time);
}
示例3: getChronometerTimeSecond
import android.widget.Chronometer; //导入方法依赖的package包/类
private int getChronometerTimeSecond(Chronometer chronometer) {
return (int) ((SystemClock.elapsedRealtime() - chronometer.getBase()) / 1000);
}
示例4: getElapsedTime
import android.widget.Chronometer; //导入方法依赖的package包/类
private long getElapsedTime(Chronometer chronometer) {
return SystemClock.elapsedRealtime() - chronometer.getBase();
}