Android Question DateTime.DateFormat: Where should it be?

pesquera

Active Member
Licensed User
Longtime User
Should I set up the format for each activity/service?
Is there a way to set up globally, for the whole application?
I wanted to clean my code.. I did that everywhere, to be sure :)
Thanks!
 

Harris

Expert
Licensed User
Longtime User
You can put it in the Main activity_create.
However, there are times when I change the format (to show seconds, for example) but then change it back to what was originally set, when done. In this case, dateformat in the activity_resume will set what the default is returning from some other activity.
Since the format is a string, you may use some globals for different settings - as you need them.
DT_Secs = "hh:mm:ss"
DT_SI = "yyyy/MM/dd hh:mm"
etc....
 
Upvote 0

Similar Threads

Top