本文整理匯總了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();
}