android DigitalClock怎么设置时间?
DigitalClock 数字时钟有什么方法设置成任意时间?难道只能显示系统时间么? Android --------------------编程问答--------------------
@Override
protected void onAttachedToWindow() {
mTickerStopped = false;
super.onAttachedToWindow();
mHandler = new Handler();
/**
* requests a tick on the next hard-second boundary
*/
mTicker = new Runnable() {
public void run() {
if (mTickerStopped) return;
mCalendar.setTimeInMillis(System.currentTimeMillis());
setText(DateFormat.format(mFormat, mCalendar));
invalidate();
long now = SystemClock.uptimeMillis();
long next = now + (1000 - now % 1000);
mHandler.postAtTime(mTicker, next);
}
};
mTicker.run();
}
这个是网上的,setText里面的内容不是可以随便改的吗? --------------------编程问答-------------------- 顶 --------------------编程问答--------------------
补充:移动开发 , Android