【发布时间】:2014-08-30 21:29:30
【问题描述】:
我是 android-programming 的新手,我想制作一个显示实际时间的应用程序。但是我刷新不了,手机的时间,我的应用的时间会不一样。
我的代码的一部分:
protected override void OnCreate(Bundle savedInstance)
{
this.SetTitle("Just a clock!");
base.OnCreate(savedInstance);
SetContentView(R.Layouts.MainLayout);
TextView tw = FindViewById<TextView>(R.Ids.textView1);
//tw.Click += new EventHandler(tw_Click);
int color = Color.ParseColor("#483D8B");
tw.SetTextColor(color);
tw.SetTextSize(60);
currentHour = DateTime.Now.Hour;
currentMinute = DateTime.Now.Minute;
tw.Text = currentHour + ":" + currentMinute;
}
我正在寻找任何可行的想法。
谢谢。
【问题讨论】: