我刚刚在我的应用程序中添加了一个计时器,它的行为很奇怪。它不是用数字来计算,而是用 CHARS 来计算!例子:
00:00:00
00:00:0(
00:00:0)
00:00:0/
00:00:0*
00:00:0+
... LOOPS AFTER 10
00:00:00
00:00:0(
00:00:0)
00:00:0/
00:00:0*
00:00:0+
xml
<Chronometer
android:id="@+id/tracking_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/record_indicator"
android:textColor="@color/tracking_time"
android:textSize="14dip"
android:textStyle="bold" />
创建
mTrackingTime = (Chronometer)this.findViewById(R.id.tracking_time);
mTrackingTime.setOnChronometerTickListener(this);
开始
mTrackingTime.setBase(System.currentTimeMillis());
mTrackingTime.start();
打回来
@Override
public void onChronometerTick(final Chronometer chronometer) {
}