0

我想创建一个将根据日期和时间更改的 textView。例如,我想创建一个显示“今天是>工作日<”的 textView。该应用程序将检查手机上的日期/时间并检查它是哪一天。例如,在 2013 年 6 月 6 日,它会说“今天是星期四”。

我会很感激任何帮助,谢谢!

4

1 回答 1

2

Yes of course, check out http://docs.oracle.com/javase/6/docs/api/java/util/Calendar.html

All you need to do is create a textview, then get the current day of the week from the Calendar library and set the text of the textview using that information.

To make it dynamic, you'll need to put this in onCreate() and possibly onResume() that way each time that application is created or restarted the content of the textview can be reset.

于 2013-06-05T20:50:39.770 回答