问题
I'm creating an android application that gets the current time in a different country/time-zone. I'm making it as there aren't many other apps on the marketplace that do the same job.
I've got an analogue clock with a digital clock underneath on my app, how do I change the time on the clocks - take on or off a number of hours? For example, I may want the clock to display the time in Florida, so for me that'd be -6 hours.
Although I'm proficient in other programming languages; mainly .NET I'm new to Java, so please excuse the simple questions!
Thankyou!
回答1:
The analog clock widget in android doesn't allow setting the time but you could adapt it as the source is available.
回答2:
If you are referring to android.widget.AnalogClock
and android.widget.DigitalClock
, they only show the current device time. They are not designed for showing arbitrary times, as you seek.
来源:https://stackoverflow.com/questions/4630490/how-do-i-set-the-time-on-an-android-analogue-clock